P
Per Forsgren
I have a DLL with a public class (MyClass).
The class is instantiated into several instances in a Windows form with :
Protected WithEvents MyInst01 As New MyClass.MyClass
Protected WithEvents MyInst02 As New MyClass.MyClass
Protected WithEvents MyInst03 As New MyClass.MyClass
Protected WithEvents MyInst04 As New MyClass.MyClass
The class has a public "Init" Function that is called from the Window form
in order to activate the functionality for each instance.
Now to the question:
Is there any way to count the number of activated instances from inside the
"Init" Function in the class. The reason is that I want to limit the use of
the class and reject over-use of it. I am open to other approaches, but they
need to be self contained from within the "Init" Function in the class.
Possible or not?
//Per
The class is instantiated into several instances in a Windows form with :
Protected WithEvents MyInst01 As New MyClass.MyClass
Protected WithEvents MyInst02 As New MyClass.MyClass
Protected WithEvents MyInst03 As New MyClass.MyClass
Protected WithEvents MyInst04 As New MyClass.MyClass
The class has a public "Init" Function that is called from the Window form
in order to activate the functionality for each instance.
Now to the question:
Is there any way to count the number of activated instances from inside the
"Init" Function in the class. The reason is that I want to limit the use of
the class and reject over-use of it. I am open to other approaches, but they
need to be self contained from within the "Init" Function in the class.
Possible or not?
//Per