Sytze de Boer wrote on 2011-12-14: 
>  I've been wondering about multi-threading
>  I don't know if I completely understand this process and I wonder if
>  someone here can throw some light on this
>  
>  In my app, there is 1 module where people have to wait from 5 to 15 secs
>  for the system to complete a process
>  (emailing a statement or invoice or quote)
>  i.e. it has to select the information, create a pdf and email it, using
CDO
>  via a Gmail account
>  
>  Is this a process that I could divert to a second "thread" so my app can
>  carry on with what ever happens after the "slow" process ?
>  Is that what multi-threading is about ?
>

Sytze,

That is a useful way to multi-thread.

VFP does not multi-thread natively. 

It can, with a DLL Christof Wollenhaupt has made available on his foxpert
site. (CMULT.DLL)
It requires adding a COM Interop class, either in a separate project as a
DLL (recommended) or in your existing EXE. The DLL is a simple regsvr32
command, the EXE path will require to run the EXE with /REGSERVER parameter.
It also requires you to add a way to receive responses from the process once
it completes. 

Probably the easiest thing, dump the parameters into a DBF, INI, XML, etc...
uniquely named file and call a second program with ShellExec to let it
happen. 

I implemented the DLL some years back to update a form in the background.

Tracy Pearson
PowerChurch Software


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to