|
-
Mar 19th, 2002, 03:04 PM
#4
Addicted Member
OK. I've done a significant amount of multithreading in VB. My programs are running very stable.
..........
'amitabh' is quit correct when he says that to do multithreading in VB6, you must use (or include) the ActiveX EXE model. (In VB5, one could use the CreateThread API. This IS NOT true in VB6.)
However, with regards to ActiveX EXE, there are still choices (which is why I mentioned it earlier):
1) You can create a Standard EXE which creates Threads from an external ActiveX EXE (a separate process).
2) You can create a ActiveX EXE that is self contained ... it can create Threads unto itself (it's own process). Additionally, it can also create Threads from another ActiveX EXE (separate process).
..........
'moinkhan' mentioned using a Timer Control to trigger code. This has NOTHING to do with multithreading and DOES NOT allow multiple jobs to be done simultaneously ... If one Timer has triggered and it's associated code is running, the form and the other timers will now be unresponsive until the first Timer's code finishes. So, it's not threaded AT ALL. Yes, you could perform a DoEvents during the first Timer's code and you would have the ILLUSION that the second Timer has triggered code - but in this case your first Timer's code has stopped (at the DoEvents) and will wait there until the second Timer's code is complete. Again, this IS NOT multithreading.
..........
However, even with ActiveX EXE's, a timer may (and likelly will) still come into play - but not the Timer Control. The timer you will be using is the API's SetTimer and KillTimer calls. If you search the web for "VB", "Thread", and "SetTimer" you will find stuff.
..........
Additionally, you can do multithreading in VB6 indirectly using the CreateThread API. In this case, you would get yourself something called PowerBASIC DLL Compiler for Windows. (NO, I DO NOT have ties with the company, but, I posess and endorse their product.) However, it is possible to do everything you want from VB6 - so don't think you need to get this.
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
|