Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return respond to client
Message
From
13/12/2000 21:55:04
 
 
To
13/12/2000 20:14:36
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00453188
Message ID:
00453215
Views:
22
>Dear all,
>
>I have a little question. I create a COM object to process a long time job. During the process, the client didn't have any indication the progress of the process. How can I show the progress bar on the client or some indication to indicate the process in progress?
>

With an out of process server, you could create a method that started a timer, cleared a property to indicate that it has work in process, and returned immediately; the timer would then fire and trigger the actual long-running method after a short delay. On completing the task, the long-running method would then change the property to indicate completion, and fill another property with the result if any needed to be passed back. Your client would have to poll the in-process property at intervals to detect completion. You could use the OS Event mechanism rather than a property; checking to see if an Event had been signalled is probably less expensive than an out-of-process COM call, but you'd need some mechanism to handle the Event. I've posted sample code for implementing Events in VFP in the File Section.

In any event, you need to poll to detect completion, and you need an out-of-process server to use a timer, which is a UI element, and needs a process context to fire in.

I do not have code to give you to implement either approach, to avoid the inevitable question. You'll have to write it yourself.
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform