Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MScomm class definition
Message
De
31/05/2005 15:00:08
 
 
À
31/05/2005 12:37:06
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01018748
Message ID:
01018791
Vues:
30
>Mark,
>
>I think, following your other thread, your best approach would be to subclass the control into a VCX. Then, assuming mybase.vcx holds your "frm" definition, and myclasses.vcx holds the "mycomm", the following works fine:
>
>SET CLASSLIB TO HOME(1)+ "libs\mybase.vcx"
>SET CLASSLIB TO HOME(1)+ "libs\myclasses.vcx" ADDITIVE
>ocommform = CREATEOBJECT("frm")
>ocommform.NEWOBJECT("comminput","mycomm")
>ocommform.ADDPROPERTY("inbuffer","")
>loinhandler = NEWOBJECT("incomm")
>
>* settings as appropriate
>WITH ocommform.comminput
>  .commport = 1
>  .settings = '9600,N,8,1'
>  .dtrenable = .T.
>  .handshaking = 2
>  .rthreshold = 1
>  .sthreshold = 0
>  .rtsenable = .T.
>  .portopen = .T.
>ENDWITH
>EVENTHANDLER(ocommform.comminput.OBJECT,loinhandler)
>ocommform.SHOW() && or not
>READ EVENTS
>
>DEFINE CLASS incomm AS CUSTOM
>  IMPLEMENTS dmscommevents IN mscomm32.ocx
>  PROCEDURE dmscommevents_oncomm
>*!* Your code here...
>  ENDPROC
>ENDDEFINE
>
ocommform.NEWOBJECT("comminput","mycomm")
Is that correct?
A form does not have such method.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform