Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM event hangs VFP
Message
De
18/03/2006 10:47:58
 
 
À
18/03/2006 09:13:10
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01105535
Message ID:
01105544
Vues:
14
Hi,

Don't know what the problem maybe - just curious as to why you can't handle this directly from VFP using the MSComm OnComm() event ?

Regards,
Viv

>I wrote a COM DLL using ATL 3 (VC++ 6) to access serial ports. The intent is to send a cmd character string to a weighing indicator and have a thread(s) in the DLL process the indicator's response and fire an event. Once a cmd string has been sent to the DLL, VFP can go about other business (possibly working with a different serial port) until the event arrives - thereby eliminating serial port polling.
>
>The trouble is - a test VFP program runs for anywhere from 2 to 10 minutes (each indicator response requires about 100 ms), then completely locks up my machine. I've experimented with AutoYield set to either .T. and .F. (I'm not sure I understand exactly what AutoYield does with a COM DLL) and experienced the same failure.
>
>A similar test case in VB6 runs infinitely with no problems.
>
>I have a critical section in the DLL's event code to insure that each event must be handled before another one can be fired.
>
>I can see in the VC6 debugger that VFP is creating a new thread every time VFP calls into the DLL while VB6 does not create a thread.
>
>Does anyone know what's the problem and how to fix it. If this is a fundamental VFP problem, I may have to resort to VB6 to write this application (sigh).
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform