General information
Category:
COM/DCOM and OLE Automation
>>>Are you generating your form and container in code?
>>No, not the form.
>>I am running it like this:
>>o = NEWOBJECT('form1', 'classname.vcx')
>
>And the container with the OCX?
It's not a container.
It's defined like this:
DEFINE CLASS ComReader AS OLEControl
OLECLASS = 'MSCOMMLib.MSComm.1'
poComReader = NULL
pclastreading = ''
FUNCTION Init
*This.poComReader = CREATEOBJECT('MSCOMMLib.MSComm')
WITH This
.Rthreshold = 1
.CommPort = 8
.Settings = "9600,N,8,1"
.InputLen = 20
.PortOpen = .T.
ENDWITH
ENDFUNC
Procedure OnComm
lcInput = CHRTRAN(This.Input, CHR(13), '')
lcInput = CHRTRAN(lcInput, CHR(10), '')
lcInput = CHRTRAN(lcInput, '*', '')
*!* Check if it's the same scan then ignore
IF This.pcLastReading == lcInput
RETURN ''
ENDIF
This.pcLastReading = lcInput
RETURN lcInput
ENDPROC
FUNCTION Destroy
This.PortOpen = .F.
ENDFUNC
ENDDEFINE
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only