Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding methods to a class object
Message
From
15/08/2007 19:48:39
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:
01248413
Views:
27
You are so much smarter than I am. Yeah, but can you paint and sculpt? Huh?! <g>

Ok, I'll have to try this tomorrow. I'm wiped out for tonight. I may need to back up and see if I'm approaching this problem from the right direction. Seems way more complicated than what I want to try and do. I've got to really find out why that specific OLE requires the _GDIPlus class that is only available in VFP9. That's what driving this whole COM/DLL functionality.

>Jay,
>
>I never used the Winsock control other than for very simple tasks where I droped it on a form, but I think that in your case you should implement it's interface to get the events, something like the following (I am not 100% sure if the following works, it is just what I would try first)
>
>
>
>DEFINE CLASS EMPS_Out_Class AS form 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)
>		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
>
>	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
>
>
>
>[Update]
>I noticed you have references to thisform and to some procedures, while the latter might work, i will add them as methods of the class instead
Previous
Reply
Map
View

Click here to load this message in the networking platform