How To Enforce Initialization of a VB OLE Class Object (138065)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q138065 SUMMARY
This article suggests a way to enforce the proper initialization of a
Visual Basic OLE object that is instantiated from a class module. The class
module has an Initialize event that is invoked each time an object of that
class is instantiated.
However, it is not possible to pass any parameters to the Initialize event
of a class module. To implement an object constructor that takes parameters
to properly initialize the object's members, you can define a Public method
(called Create for example) in the class module and call it with parameters
immediately after instantiating the object.
Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
---|
Keywords: | kbcode kbhowto KB138065 |
---|
|