Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MScomm class definition
Message
From
31/05/2005 14:31:51
 
 
To
31/05/2005 12:37:06
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01018748
Message ID:
01018783
Views:
27
>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
>
And after I get EVENTHANDLER working how do I get Input value ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform