ox = CREATEOBJECT( "EMPS_Class" ) ox.oSock.SendData("This is a test.")And this is the class definition:
********************************************************** DEFINE CLASS EMPS_Class AS SESSION OLEPUBLIC ********************************************************** IMPLEMENTS DMSWinsockControlEvents IN "c:\windows\system32\mswinsck.ocx" ********************************************************** PROCEDURE DMSWinsockControlEvents_Error(NUMBER AS INTEGER, DESCRIPTION AS STRING, Scode AS NUMBER, SOURCE AS STRING, HelpFile AS STRING, HELPCONTEXT AS NUMBER, CancelDisplay AS LOGICAL) AS VOID HELPSTRING "Error occurred" * add user code here ENDPROC ********************************************************** PROCEDURE DMSWinsockControlEvents_DataArrival(bytesTotal AS NUMBER) AS VOID HELPSTRING "Occurs when data has been received from the remote computer" strData = SPACE(256) && Define string to pass to GetData THIS.oSock.OBJECT.GETDATA(@strData) * Testing code to parse HL7 billing data from Medinotes Client to EM tables =Convert_HL7_Billing_Data(strData) ENDPROC ********************************************************** PROCEDURE DMSWinsockControlEvents_Connect() AS VOID HELPSTRING "Occurs connect operation is completed" * add user code here ENDPROC ********************************************************** PROCEDURE DMSWinsockControlEvents_ConnectionRequest(requestID AS NUMBER) AS VOID HELPSTRING "Occurs when a remote client is attempting to connect" #DEFINE sckClosed 0 IF THIS.OBJECT.State <> sckClosed THIS.oSock.OBJECT.CLOSE ENDIF *!* Accept the request with the requestID *!* parameter. THIS.oSock.OBJECT.ACCEPT(requestID) ENDPROC ********************************************************** PROCEDURE DMSWinsockControlEvents_Close() AS VOID HELPSTRING "Occurs when the connection has been closed" * add user code here ENDPROC ********************************************************** PROCEDURE DMSWinsockControlEvents_SendProgress(bytesSent AS NUMBER, bytesRemaining AS NUMBER) AS VOID HELPSTRING "Occurs during process of sending data" * add user code here ENDPROC ********************************************************** PROCEDURE DMSWinsockControlEvents_SendComplete() AS VOID HELPSTRING "Occurs after a send operation has completed" * add user code here ENDPROC oSock = NULL ********************************************************** PROCEDURE INIT THIS.oSock = CREATEOBJECT("MSWinsock.Winsock.1") EVENTHANDLER(THIS.oSock, THIS) ENDPROC ENDDEFINE