>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.