Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OCX install?
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00720617
Message ID:
00720624
Views:
10
>I need to test if an specific OCX is installed in the systme, if not, I will install it, programatically off course!

I would do someting like this:
LOCAL loObjectProvider As ObjectProvider
LOCAL loObject As Object

loObjectProvider = CREATEOBJECT("ObjectProvider")
loObject = loObjectProvider.GetObject("YourOCXClass")

IF ISNULL( loObject )
	*-- ... Install and re-initiate the object
ENDIF

DEFINE CLASS ObjectProvider As Session
	
	FUNCTION GetObject( cObjectName as String ) As Object
		
		LOCAL loObject As Object
		loObject = CREATEOBJECT( cObjectName )
		
		RETURN IIF( VARTYPE(loObject) == "O", loObject, NULL )

	ENDFUNC
	
	PROTECTED FUNCTION Error( p1, p2, p3 )
		*-- Don't process errors
	ENDFUNC

ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform