Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21266

MultiThreading in VB6

$
0
0
Ok for a few months now when I have time I have been trying all the examples out there for multi threading... This is what I have found.

The use of activeX.exe's are the best and most reliable to do this. Simply put you create a acitiveX exe file that contains a class or classes that the threaded work needs to be done in. Then you create an instance 'withevents' of that acitvex exe within you main project. Your activex.exe can now fire events and send the results, it is recommended that you start a timer for one cycle to call the intended method to avoid hangs.. etc back to the main application, and the main application can call methods that run in a seperate thread in the activex .exe. Works Great and from what I have read it is the Most reliable way to do threading in VB6.

Having said that... Here is my problem.

I am using the bass.dll library for my application. One of the external methods i use needs to be called from a separate thread so the main gui does not stop responding waiting for a return from that function. The problem is that external function call requires that the processID is the same as other calls to the library for it to work. So using the activex solution does not work because the processID of the activeX is both in a new thread but also a different processid.

I am not a expert at this at all, but I have seen some posts talking about inprocess threading using olaf's directCom.dll. I could not find examples of this. If any one has any examples or other solutions please let me know. I have looked at so many and they seem so complicated I get a bit lost. I was hoping for something an average vb6 dev can understand.

Thanks for your time.
Winston P

Viewing all articles
Browse latest Browse all 21266

Trending Articles