Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE Exception code using my class
Message
De
22/08/2007 13:25:55
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
OLE Exception code using my class
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01249645
Message ID:
01249645
Vues:
108
Getting this error:

OLE IDispatch exception code 0 from Winsock: Wrong protocol or connection state for the requested transaction or request.

On the 2nd line:
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform