|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Muliple Instances of the Same ActiveX Class
Hi Guys (mainly Doug!),
How do I make a program load multiple instances of the same ActiveX class. I have the following code: Code:
Set Tester(1) = Nothing
Set Tester(1) = CreateObject("Example.TestClass")
Set Tester(2) = Nothing
Set Tester(2) = CreateObject("Example.TestClass")
But both Tester(1) and Tester(2) are just loading the same control, so techncially speaking, Tester(1) and Tester(2) are just mirrors of one another. I want to know how to load 2 independent ActiveX controlls. I thought the code wwould be the following, but it does not work: Code:
Set Tester(1) = Nothing
Set Tester(1) = New CreateObject("Example.TestClass")
Set Tester(2) = Nothing
Set Tester(2) = New CreateObject("Example.TestClass")
Any Ideas? Because the above code wont work. To be a bit more clear, I am using ActiveX EXEs, and with the code I am uisng at the momney, only 1 process is loaded, and Tester(1) and Tester(2) are simple controlling the same process. What I want to hapeen is for 2 seperate processes to be loaded.
__________________
LozWare Website Directory Whooo! Free submissions, no recip needed. I'm a nice guy
Last edited by LozWare : April 15th, 2006 at 07:06 PM. |
|
#2
|
|||
|
|||
|
From your code tester(1) and tester(2) are either an array, or a control array, in either case the variables are independent of one another.
Your object may prevent multiple instances. Otherwise try using ByVal somewhere (but I don't know where) ![]()
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
||||
|
||||
|
Thanks Doug, I have found the problem, but I dont know how to overcome it. The controls are still indipendant from one another - but at the same time they are not! Only 1 process is loaded - and I have a form on the ActiveX EXE, and only 1 of them is loaded too.
However, the actaul class is loaded multiple times - so techncially it is working. BUT this is not what I want. I want a completely seperate process to be loaded each time a new class is created. |
|
#4
|
||||
|
||||
|
Dont Worry, I have found a little work around.
I have turned the ActiveX EXEs into StandAlone EXEs, and I have turned the Standalone EXE (the one that was originally loading the ActiveX EXEs) into an ActiveX EXE. Its just like a Database relationship really... Many-to-one Standalone-to-ActiveX lol |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Muliple Instances of the Same ActiveX Class |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|