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:
01248403
Views:
23
Are you working with the existing visual form class and trying to convert it into OLEPUBLIC class based on session?

Start from the visual form and check the code in the Class Browser. Then convert it.

>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