Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding methods to a class object
Message
 
 
To
15/08/2007 19:19:32
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01248400
Message ID:
01248402
Views:
25
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform