Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pausing in my .dll
Message
De
10/01/2000 20:55:04
 
 
À
10/01/2000 17:56:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00315821
Message ID:
00315896
Vues:
28
>I am working on a web page that uses a created VFP .dll. I need to put a pause in the .dll while it waits for a file. I have set up a do while statment until it returns which sends the utilization up to 100%. I've tryed using a timer, but the time doesn't seem to fire in the page. Has anyone experienced similar problems?
>

VFP in-process COM servers can't have any UI, and tiemrs qualify as UI. Your best bet would probably be to use the Win32 API cll Sleep(). I haven't tried this in a .DLL, but it'd look like:

DECLARE Sleep IN Win32API INTEGER dwMilliseconds
=Sleep(1000) && wait 1 second = 1000ms

Depending on exactly what's happening, other API calls may be more desirable - the caveats for the Sleep() call from the MSDN are:

Remarks
A thread can relinquish the remainder of its time slice by calling this function with a sleep time of zero milliseconds.

You have to be careful when using Sleep and code that directly or indirectly creates windows. If a thread creates any windows, it must process messages. Message broadcasts are sent to all windows in the system. If you have a thread that uses Sleep with infinite delay, the system will deadlock. Two examples of code that indirectly creates windows are DDE and COM CoInitialize. Therefore, if you have a thread that creates windows, use MsgWaitForMultipleObjects or MsgWaitForMultipleObjectsEx, rather than Sleep.

MAPI: For more information, see Syntax and Limitations for Win32 Functions Useful in MAPI Development.


If you're waiting for a process you've launched to complete, you may want to look at using CreateProcess() to launch it and then monitor it's completion; look at my API_APPRUN class for examples of how this might be used.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform