Hi!
I'm developing Activex component in visual basic 6 and it need to used a thread in it.
Can I use threads in?
How can I do it?
thanks
cnavas
Printable View
Hi!
I'm developing Activex component in visual basic 6 and it need to used a thread in it.
Can I use threads in?
How can I do it?
thanks
cnavas
u can take advantage of threads only in ActiveX EXE.
when u create ActiveX EXE, u can specify weather u want new thread for each client, a pool of threads or single thread to all of the clients.
an ActiveX DLL always run in the thread who create it (STA), it means that it cannot accessed concurrently by two or more clients.
VB don't give u the freedom to create COM object that can handle multiple calls concurrently (ie MTA object).
so take care of creating ActiveX EXE, because the objects creating in a different process, and matters like marshaling overhead etc. must considered.
you can be API i think...
You can call CreateThread() in VB -it's a VB function. But you can only use it when you compile to pcode.
i read the comments that the other fellows suggest and i have something very important to say:
don't ever use the function CreateThread in vb.
u should read and understand very well COM Apartments before get writing some thread code.
link to the following for more info:
http://www.desaware.com/articles/threadingL3.htm
http://codeguru.earthweb.com/activex...artments1.html
Thanks for your help!:)
the api is not very stable though.