Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anyone doing multithreading in VFP?
Message
De
20/05/2009 16:18:48
 
 
À
20/05/2009 15:46:49
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01401052
Message ID:
01401108
Vues:
112
>>>Do any of you do multi threaded applications in VFP? If so what, if any, tools, tricks, hoops do you need to jump thru to make it work?
>>>
>>>I've looked at the stuff on http://www.codeplex.com/mtmyvfp which is based on some work that Calvin Hsia did a while back. I can make it work "out of the box", but whenever I try to do my own code, it errors with "Error AfterCalling COM object" and I can't figure out why. Claude makes it sound like childs play to do multi threading in VFP, but, thus far it's nothing but a pain in the @@@.
>>>
>>>I know about the multi threaded runtime version of the VFP dll. What's it for? Please don't say "multi threading" :)
>>
>>Do you have a specific task in mind? Can you outline it?
>>
>>There may be other approaches possible, such as spawning multiple EXEs rather than multithreading.
>
>What I'm trying to accomplish is to produce a "dashboard" style application where there are several panels or "widgets" each showing different sets of information. I've got a web browser control rendering HTML generated by VFP's text handling capabilities. Because each widget's content is independent of the others and could potentially take longer for some to generate their information, I thought this would be a good candidate to try my hand at multi threading. I'd like to have the dashboard ready to be used for those widgets that have their content generated almost instantaneously and show a "busy" indicator for those that are taking longer. I think they call this "asynchronous AJAX" in the web world :)
>
>Currently I have the widget content being generating in code from a multi threaded dll. A timer is creating the objects from that dll. It appears to work except when a long process is encountered that then holds up the production of the rest of the widgets. So in short, it would appear to me that it is not working as a multi threaded dll :(

Hmm, I haven't worked with MTDLLs but from looking at the help, your task looks like it could be a good match: http://msdn.microsoft.com/en-us/library/ezck9bk3(VS.80).aspx

- If you're working with ActiveXs you may need to experiment with _VFP.AutoYield

- It might help to put DOEVENTS calls in looping code

- Never used it, but SYS( 2336 ) is related to MTDLLs

Can you tell what the long processes are, such as SELECT - SQL that's taking a long time to run? It's possible to work around some of those issues.

There's a discussion on the FoxWiki with links to other resources: http://fox.wikis.com/wc.dll?Wiki~VFPMTDLLisMultithreaded~VFP
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform