How To Determine When the Initialize Event of Class Gets Fired (154651)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- 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 Q154651 SUMMARY
When you create an instance of one of your class modules in Visual Basic
code, the Initialize event is the first operation that occurs. You can
use this fact to explore the timing of object creation when you declare
object variable As New. Below is some sample code showing how to
demonstrate the issue.
REFERENCES
Visual Basic Help File.
The Visual Basic Programmers Guide 4.0 Chapter 7, P.200 and P.218.
The Visual Basic Programmers Guide 5.0 Chapter 5, P.156 and P.160.
For more information, please see the following articles in the Microsoft
Knowledge Base:
138065 How to Enforce Initialization of a VB OLE Class Object
129449 Object Created w/ NEW Instantiated When Passed as Argument
Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
---|
Keywords: | kbhowto KB154651 |
---|
|