Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EXE COM crashes
Message
From
27/08/1999 12:07:10
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
EXE COM crashes
Miscellaneous
Thread ID:
00258472
Message ID:
00258472
Views:
56
I've created a COM that is used to send data through the modem. The COM is build as a EXE and it use the MSComm object. It work great, except that when I quit it, it give me an error message (This application has caused an illegal operation and will be shut down...). If I build the COM as a DLL, it doesn't give me this error message.

To get this COM to work, I have used the VFPCOM.BindEvents(). I have also used some DOEVENTS, this command is not allowed in a DLL, so that's why I'm stuck with a EXE.

Here is the code in the Init():

THIS.ModemComm = NEWOBJECT("MSCOMMLib.MSComm")
THIS.EventHandler = NEWOBJECT("OnComm", "Comm")
THIS.VFPCOM = NEWOBJECT("VFPCOM.ComUtil")
THIS.VFPCOM.BindEvents(THIS.ModemComm, THIS.EventHandler)

And here is the Destroy():

THIS.VFPCOM.UnBindEvents(THIS.ModemComm, THIS.EventHandler)
THIS.VFPCOM = NULL
THIS.EventHandler = NULL
THIS.ModemComm = NULL

If I comment out these lines in the Init() and Destroy(), I don't get the error, so I guess that something there is causing me problems. It crashes also if I don't put code in the Destroy() event.

Help...

TIA
Next
Reply
Map
View

Click here to load this message in the networking platform