|
-
Feb 3rd, 2007, 08:37 PM
#1
How to keep track of the class instances in the class?
Hi guys, I am wondering if there is a way to keep the count of the class instances in the class. In C ++ you can declare a Static variable in the header file and access it from different instances of the class. Is it possible to do in vb? Thanks
Last edited by VBDT; Feb 3rd, 2007 at 08:46 PM.
-
Feb 3rd, 2007, 09:39 PM
#2
Re: How to keep track of the class instances in the class?
VB has no header files but you can just as easily declare a Shared variable. You'd need to implement Dispose and Finalize methods so that the count could be decremented when an instance was destroyed. You'd increment the count in the constructor.
-
Feb 3rd, 2007, 11:15 PM
#3
Re: How to keep track of the class instances in the class?
Thanks Jmc! that worked perfect
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|