Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
EXE COM crashes
Message
De
27/08/1999 12:07:10
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
EXE COM crashes
Divers
Thread ID:
00258472
Message ID:
00258472
Vues:
57
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform