Link to home
Start Free TrialLog in
Avatar of Mr_A_Smith
Mr_A_Smith

asked on

VB and Threads?

Dear Experts

I need to wait for a boolean variable to become TRUE before i can proceed through to the next statement - this boolean variable is set to true when an event occurs - is there anyway i could possibly create a thread which keeps evaluating this process. or simply wait for the event to occur before the program execution carries on?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Read this article about threads in VB:
http://www.desaware.com//articles/threadingL3.htm

Quite often, the method to achieve this in VB is to use ActiveX EXEs:
thread/exethr.htm">http://www.vbaccelerator.com/codelib/thread/exethr.htm

Multi Threading in VB can be accomplish throw activeX exe
Don't use Createthread since VB6 is an appartment thread and It will may cause your system to crash.
Save yourself the trouble and do it with .NET
If you want to do it with VB 6 you should read this from the vb6 documentaion
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconprojectoptionsforcodecomponents.asp

2 more examples:
Rant: Multithreading: A Kludge for Poor Software Design
http://www.vb-helper.com/rant_multithreading.html
HowTo: Let a long process run asynchronously without multithreading
http://www.vb-helper.com/howto_async_process.html 
Avatar of Mr_A_Smith
Mr_A_Smith

ASKER

Dear Dhaest,

Your first post did the trick, no threading needed. Thank you very much :)