PRB: TypeOf Operator Does Not Recognize Form Object
Article ID: 194570
Article Last Modified on 5/13/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 6.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
This article was previously published under Q194570
SYMPTOMS
You are passing an object to an ActiveX component, and attempting to use
the TypeOf operator to determine if the passed object is a form. TypeOf
returns False, even if the object is a form.
RESOLUTION
Do not pass or return forms, controls, or other private objects as method
arguments of an ActiveX component or control. Such objects are not intended
for use in this manner, even though such operations may have succeeded in
previous versions of Visual Basic. See the REFERENCES section below for
more information.
STATUS
This behavior is by design.
REFERENCES
For more information, query on the topic "On the Evils of Returning Private
Objects" in Visual Basic 5.0 Books Online or Visual Basic 6.0 Online Help.
Additional query words: kbDSupport kbDSD kbVBp kbVBp500 kbVBp600 kbCtrl
Keywords: kbprb KB194570