|
-
Jul 30th, 2000, 02:16 PM
#1
Thread Starter
Member
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.
-
Jul 30th, 2000, 02:28 PM
#2
Fanatic Member
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.
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Jul 30th, 2000, 05:52 PM
#3
Thread Starter
Member
How about the events?? The main concern is the events.
-
Jul 30th, 2000, 05:59 PM
#4
Sorry!
You can't create an array when your using the WithEvents keyword.
-
Jul 30th, 2000, 06:08 PM
#5
Frenzied Member
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
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
|