Hi
I want to know the no of instances running for a dll.
Thanks in advance
Printable View
Hi
I want to know the no of instances running for a dll.
Thanks in advance
Have a general module in your DLL with a global variable. Increment it everytime your class initializes and decrement it every time your class terminates.
e.g.
NOTE:Code:Private Sub Class_Initialize()
gintInstanceCount = gintInstanceCount + 1
End Sub
Private Sub Class_Terminate()
gintInstanceCount = gintInstanceCount - 1
End Sub
All instances of a DLL class instantiated in the same thread will share global variables (Make sure you have a thread pool of one and not one thread per object).