Results 1 to 5 of 5

Thread: [Resolved] Monitoring status using a timer

  1. #1

    Thread Starter
    Hyperactive Member Arachnid13's Avatar
    Join Date
    Jan 2003
    Location
    England
    Posts
    327

    Resolved [Resolved] Monitoring status using a timer

    Hi

    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!
    Last edited by Arachnid13; Mar 30th, 2007 at 03:23 AM. Reason: resolved
    Do you wake up in the morning feeling sleepy and grumpy? Then you must be Snow White

  2. #2
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    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.

  3. #3
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    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.

  4. #4

    Thread Starter
    Hyperactive Member Arachnid13's Avatar
    Join Date
    Jan 2003
    Location
    England
    Posts
    327

    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.
    Do you wake up in the morning feeling sleepy and grumpy? Then you must be Snow White

  5. #5
    Addicted Member kewakl's Avatar
    Join Date
    Oct 2006
    Location
    between keyboard and chair
    Posts
    220

    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...
    Do not use if shrinkwrap is broken or missing!
    I'm learning how to fish, too!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width