>>>poComReader = '' >>>PROCEDURE INIT >>> This.poComReader = CREATEOBJECT('MSCOMMLib.MSComm') >>> WITH This.poComReader >>> .CommPort = 8 >>> .Settings = "9600,N,8,1" >>> .InputLen = 1 >>> .PortOpen = .T. >>> ENDWITH >>> EVENTHANDLER(This.poComReader, This) >>>ENDPROC >>I never used this ActiveX control so cannot tell which settings you would need to get it to work.
* Some other class, not the Event Handler PROCEDURE INIT This.poComReader = CREATEOBJECT('MSCOMMLib.MSComm') oEvents = NEWOBJECT("MscommEventHandler") EVENTHANDLER(This.poComReader, oEvents) ... ENDPROC DEFINE CLASS MscommEventHandler AS session IMPLEMENTS DMSCommEvents IN "c:\windows\system32\mscomm32.ocx" PROCEDURE DMSCommEvents_OnComm() AS VOID; HELPSTRING "Occurs whenever the value of the CommEvent property changes." * add user code here ENDPROC ENDDEFINE