Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rteurning control...

Status
Not open for further replies.

ralphtan

Technical User
Oct 15, 2002
15
SG
I have a programming which has this process..

a command button is depressed and a ".dll" process is invoked. the ".dll" process will communicate with a hardware and monitor its status. However, the button is "dim" and the program is to be "hanged" but actually, it is waiting for the ".dll" to finished the process.

Is there anyway that I can gain control back while letting the ".dll" monitor the process and update to a label windows?

thanks.
 

If it is your dll then put some doevents in it to allow other processes some cpu time

What dll is it ?
 
You won't get control back until the dll has returned from the method you invoked. And since it's single threaded, you can't have the dll loop to monitor your device and the application perform its duties.

Put the code that's in the dll in an ActiveX EXE and simulate asynchronous behaviour by setting a timer in the method that initiates the monitor process. Return immediately after the timer has been set (your app now has control again) and start the actual monitor process when the timer fires. Since it's out of process now, your app and the monitor process can run "at the same time" side by side. Use events to update status from within the monitor process to your app.
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top