-
Hey, I created an ActiveX DLL, and now i want to use it. I use withevents to instantiate an instance of it, like:
private withevents mydll as thedll.substuff
now how do i go and create an array of it? like create more than 1 instance of 'substuff'?
thanks in advance.
-
Instead of instancing the DLL through code everytime you want to use it, why not set its "Instancing" property to "6-GlobalMultiUse" and then goto "Project" - "References" and select your DLL.
This way you can call it just like any other function in VB.
Say your DLL has a function in it called "DogYears" and it returns a long.
The DLL Code:
Code:
Function DogYears(YourAge) as Long
DogYears = YourAge * 7
End Function
After you've set a reference to your DLL Call it from your project as follows:
Code:
Private Sub Command1_Click()
MsgBox DogYears(21) 'Returns 147 (as long)
End Sub
Just thought this might be easier for you, after I discovered how to I never did it the other way again.
-
How about the events?? The main concern is the events.
-
Sorry!
You can't create an array when your using the WithEvents keyword.
-
yer best bet is to create a sort of linked list that can carry events down a chain of wrapper objects, then have this all contained in a container class, similar to how VB collections work. It's not all that easy tho