Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding an instance of an ActiveX class at run-time
Message
From
01/11/2007 10:47:45
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
01/11/2007 06:26:21
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01265383
Message ID:
01265726
Views:
13
>Not sure what it means to "...add an instance of the class at run-time instead of adding the control."
>
>It means that in the Visual Class Designer, Create a Winsock subclass by creating a class based on the OLEcontainer control and inserting the winsock control ( C:\WINNT\System32\mswinsck.ocx ).
>
>Then, instantiate your custom winsock class using CREATOBJECT().

I'm doing mine in code. It's a non-visual service EXE. I currently use the following, but we are getting licensing errors on some boxes. What do I need to change, per the MSN help I posted, to fix this?
DEFINE CLASS EMPS_Class AS SESSION OLEPUBLIC

	* Using the MSWinsck control for basic port communications
	IMPLEMENTS DMSWinsockControlEvents IN "mswinsck.ocx"

	lGarbageCollected = .F.

	oSock = NULL


	**********************************************************
	PROCEDURE INIT

		* Create the port communication object
		THIS.oSock = CREATEOBJECT("MSWinsock.Winsock.1")

	ENDPROC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform