Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a better mscomm?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00443243
Message ID:
00443596
Vues:
7
The way I captured my OnComm event was to use VFPCOM's utilities.

* NOTE - code by command line entry.
*
* Create PRG file with class code that contains method onComm.
x = createobject("VFPCOM.COMUtil")
y = createobject("Mscommlib.Mscomm.1")
x.exportevents(y, "c:\myComm.prg")
x = .null.
y = .null.
**********************************
* myComm.prg would contain something like...
*
* DEFINE CLASS DMSCommEvents AS custom
*
*     PROCEDURE OnComm
*     * Add user code here
*     ENDPROC
*
*
*ENDDEFINE
*
**********************************
* 
* Then in your code, create the object from the myComm.prg file...
* 
x = createobject("VFPCOM.COMUtil")
y = createobject("Mscommlib.Mscomm.1")
myComm = createobject("DMSCommEvents") 
x.BindEvents(y, myComm)

* Now when oncomm your onComm will handle the event correctly.
x.UnBindEvents(y, myComm)
x = .null.
y = .null.
myComm = .null.
* Hope this helps.

George.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform