Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multitasking from VFP
Message
From
16/07/2004 06:51:28
 
 
To
15/07/2004 16:27:15
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00924617
Message ID:
00925082
Views:
28
This message has been marked as a message which has helped to the initial question of the thread.
No, if you just recompile your DLL into a EXE, you will wait for the completion of the Requery just like you did in the DLL version. There is no difference.

When VFP call a method in a COM, it wait until the method come back since VFP use only one thread for the running application. To trick VFP to continue while the method is still executing, is to use the code I gave you earlier, that is to use a timer to simulate a new thread. Basically what it does is this:

1) VFP call the COM method (let say DoIt)
2) DoIt set the timer interval to 1 ms (just to get it on) and return immediatly
3) VFP gets the response and continue executing the code
4) The timer fire in the COM
5) The Timer event call the real method that will do the job you requested in the first time (Requery)

To get this running, you need a EXE COM. A DLL run in the same process of the calling module and thus will share the same thread, so the timer will interrupt the current work flow (only one thread executing.) A EXE COM run in a separate process and have it's own thread. So when the timer will fire, it will use it's own thread to get the work done while the main VFP application will continue to run on it's thread.

It's not as pretty and easy as if VFP had multithread support (wish it had), but it get the job done.

HTH

>That sounds great but I am confused.
>
>Perhaps best if I use a code example:
>
>oitfapp=Createobject("itfcom.itfcomapplicationobject")
>
>oitf_oicurrentbalancebo=oitfapp.obizobjs.add("v_oi_current_balance_by_sobizobj")
>oitf_oicurrentbalancebo.setparameter("VP_cinmate_identifier",tcinmateid)
>oitf_oicurrentbalancebo.requery()
>
>So I create the COM object.
>
>At varions places through the calling app, I issue obizobjs.add which basically creates a view. Then set a parameter on the view and requery it.
>
>The 3 lines basically create a view andpull the balance info for an account.
>
>It is the requery line that populates the view. That is the line I would like to be able to say "Populate the view. I will check back later to see if you have my balance yet."
>
>So are you saying, when I issue ANY of these lines (using an EXE rather than DLL), the only difference will be that the lines will execute without the calling program doing any waiting?
Previous
Reply
Map
View

Click here to load this message in the networking platform