General information
Category:
COM/DCOM and OLE Automation
Title:
COM event hangs VFP
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).
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only