[Resolved] Monitoring status using a timer
Hi :D
I have a project consisting of a form and a file i have made, the form acts as the user interface for the dll. The job of the dll is to pull some info from a database, use this information to request a URL from an HTTP server, and then create and send an XML request to the URL. This is all working 100% but as it takes a little while to perform these tasks i have created a public variable which changes as to the particular task the dll is performing (i.e. 0=idle, 1=accessing database etc etc). The problem is that i have set up a timer to change the contents of a text box when the variable changes, but the timer code will not run while one of the dll functions is being called, even though in the dll code i have put a doevents after each change of the status variable... is there another way of monitoring the variable that will work?
Thanks!
Re: Monitoring status using a timer
Like any API call, you have to wait for the function to finish before your application gets control again.
What you can do is make your dll code more effecient so as to return control back to your application more quickly.
Re: Monitoring status using a timer
The only way around that is to change your dll to a ActiveX exe and your app will run at the same time as the Activex exe.
But this will present other timing issues in your app.
Re: Monitoring status using a timer
@Hassan Basri:
I probably didnt quite word that right, when i said it takes quite a while, what i meant was the time it takes for the responses from the servers, the code itself is fast enough. But i fixed the problem anyway just by sticking a short (0.1 second) loop containing the doevents in instead of the straight doevents call. i know, not too efficient, but adding half a second to a 15 second function so that the user can see whats going on is worth it imho.
Thanks for the suggestions anyway guys.
Re: [Resolved] Monitoring status using a timer
Just a thought:
could you implement a callback routine in your .dll and change the call's syntax to provide an AddressOf _CallbackRoutine_ ?
I have no Idea if this is possibly...