Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MScomm class definition
Message
From
31/05/2005 15:32:22
 
 
To
31/05/2005 15:12:07
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01018748
Message ID:
01018807
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
>>>
>>
>>ocommform.NEWOBJECT("comminput","mycomm")
>>Is that correct?
>>A form does not have such method.
>
>
>Sure does...
>
>ofrm = CREATEOBJECT("form")
>ofrm.
>
>in the Command Window tells me so.

Yes, you are right.
But still dont know how to get Input value into my code.
Previous
Reply
Map
View

Click here to load this message in the networking platform