Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding an instance of an ActiveX class at run-time
Message
From
31/10/2007 10:33:18
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Adding an instance of an ActiveX class at run-time
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01265383
Message ID:
01265383
Views:
67
Not sure what it means to "...add an instance of the class at run-time instead of adding the control." The following is from http://support.microsoft.com/default.aspx?scid=kb;EN-US;192693 and is a resolution to a known issue with ActiveX controls in EXEs.
Add the control you want to use into a class that is saved in a Visual Class library or into a class 
created with the DEFINE CLASS command. Next, add an instance of the class at run-time instead of 
adding the control.
I'm currently using this to access the control:
DEFINE CLASS EMPS_Class AS SESSION OLEPUBLIC

	* Using the MSWinsck control for basic port communications
	IMPLEMENTS DMSWinsockControlEvents IN "c:\windows\system32\mswinsck.ocx"

	lGarbageCollected = .F.

	oSock = NULL


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

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

	ENDPROC
Next
Reply
Map
View

Click here to load this message in the networking platform