Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding methods to a class object
Message
 
 
À
15/08/2007 19:19:32
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01248400
Message ID:
01248402
Vues:
27
The oSock must be a subclass of your own class based on Winsock then and there you would define this method.

Why you cannot have code in the EMPS_Out_Class?



>I want to assign code to procedures that belong to the oSock object. I know the way it is below isn't correct, but how do I add a method called ConnectionRequest that contains the code in the block below to oSock? So that I would have EMPS_Out_Class.oSock.ConnectionRequest() as a method that I could then call from elsewhere.
>
>
>DEFINE CLASS EMPS_Out_Class AS SESSION OLEPUBLIC
>
>	oSock = NULL
>
>	PROCEDURE INIT
>
>		THIS.oSock = CREATEOBJECT("MSWinsock.Winsock.1")
>
>	ENDPROC
>
>
>	PROCEDURE ConnectionRequest
>
>		*** ActiveX Control Event ***
>		LPARAMETERS requestid
>
>		#DEFINE sckClosed 0
>
>		If This.Object.State <> sckClosed
>			This.Object.Close
>		ENDif
>
>		*!* Accept the request with the requestID
>		*!* parameter.
>		This.Object.Accept(requestID)
>
>	ENDPROC
>
>
>	PROCEDURE DataArrival
>
>		*** ActiveX Control Event ***
>		LPARAMETERS bytestotal
>
>		strData = SPACE(256)  && Define string to pass to GetData
>
>		This.Object.GetData(@strData)
>		ThisForm.txtOutput.Value = strData
>
>		* Testing code to parse HL7 billing data from Medinotes Client to EM tables
>		Send_HL7_Demographic_Data(strData)
>
>		* Convert_HL7_Billing_Data(FILETOSTR("c:\HL7_IN\HL7BB.tmp"))
>
>		* STRTOFILE(strData,"c:\HL7_IN\HL7_Data_From_Service.txt",.T.)
>
>	ENDPROC
>
>ENDDEFINE
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform