Check out the link in my sig.
Multithreading sorted :D
Woof
Printable View
Check out the link in my sig.
Multithreading sorted :D
Woof
Just for information, if it hasn't been mentioned before - it is possible to explicitly create threads in VB, i.e. with CreateThread(). It isn't easy to do safely, because of VB's tight interaction with COM, but it can be done.
MS says that using CreateThread API is bad.
My example doesn't use CreateThread.
Woka
Define "bad". MS isn't always right.
Another problem, many people will completely misapply MT - in a lot of situations, it isn't appropriate or useful, though I'd bet people still do MT for some "cool" factor.
I suspect this is why MS made MT in VB6 limited and not easy; VB is used by many programmers who don't have the experience/interest to learn about the consequences of MT.
COM is a right pain in this case, it clouds the issues.
Fair do's.
MT in VB6 using CreateThread is dodgy and applications crash.
Find me a good example where this doesn't happen...coz I ain't found one yet, neither has anyone else I know.
Woka
Have a read of Matt Curland's excellent "Advanced Visual Basic 6", published by Addison-Wesley. Lots of good stuff in there, including threading. Really gets "behind the scenes" of VB and COM.