bpitzer
asked on
multithreading with raise event
I have checked out the "Coffe Monitor" example in the online books for VB.
I need to do something similar where I:
- create a standard EXE
- have it call an activex EXE that is configured for a new thread for each instance
(I have to be able to create a dynamic number of these, not sure how many I need to create until runtime)
- utilize callbacks to standard EXE which pass parameters indicating status, etc when
it completed
The coffeemonitor example is a little more complex than I need, and kinda hard to follow for me.
I just could use a real simple example that does this.
I want every component in each thread to use the same callback procedure on the standard exe.
Any help or sample you could send me would be appreciated!
regards,
onlybill@fuse.net
I need to do something similar where I:
- create a standard EXE
- have it call an activex EXE that is configured for a new thread for each instance
(I have to be able to create a dynamic number of these, not sure how many I need to create until runtime)
- utilize callbacks to standard EXE which pass parameters indicating status, etc when
it completed
The coffeemonitor example is a little more complex than I need, and kinda hard to follow for me.
I just could use a real simple example that does this.
I want every component in each thread to use the same callback procedure on the standard exe.
Any help or sample you could send me would be appreciated!
regards,
onlybill@fuse.net
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<<What if you wanted to spawn off several of modaltest.class1's all at the same time?
>>
it was just an *EXAMPLE* of how to make it. this onw generated only ONE instance of the object, but you can instanciate as many objects as your PC can stand :
Private WithEvents A As ModalTest.Class1
Private WithEvents B As ModalTest.Class1
Private WithEvents C As ModalTest.Class1
and later :
Set A = New ModalTest.Class1
A.start
Set B= New ModalTest.Class1
B.start
Set C= New ModalTest.Class1
C.start
now, in the ActiceX EXE project->properties, you can define that each object created will run in a SEPERATE THREAD.
you can do many things. you can add objects created to a collection..etc..
now, in this particular example - since the object event cause the client to show form2 - the form2 will be displayed only once, but you can add more functionnallity... that's just an example for you to START somewhere...
>>
it was just an *EXAMPLE* of how to make it. this onw generated only ONE instance of the object, but you can instanciate as many objects as your PC can stand :
Private WithEvents A As ModalTest.Class1
Private WithEvents B As ModalTest.Class1
Private WithEvents C As ModalTest.Class1
and later :
Set A = New ModalTest.Class1
A.start
Set B= New ModalTest.Class1
B.start
Set C= New ModalTest.Class1
C.start
now, in the ActiceX EXE project->properties, you can define that each object created will run in a SEPERATE THREAD.
you can do many things. you can add objects created to a collection..etc..
now, in this particular example - since the object event cause the client to show form2 - the form2 will be displayed only once, but you can add more functionnallity... that's just an example for you to START somewhere...
ASKER
It appears it doesn't work properly, that only the last one submitted returns?
(verified by passing parameter with event callback to tell which one fired it)
Any clue?