Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is an OCX Registered On My Machine?
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00213266
Message ID:
00214228
Views:
28
**************************************************
FUNCTION IsCOMObject
*********************
*** Function: Checks to see if a COM object 
***           or ActiveX control exists
***   Assume: Uses wwAPI
***     Pass: lcProgId   - Prog Id of the Class
***           lcClassId  - (Optional) If passed in 
***                        by reference gets ClassId
***           lcClassDescript - (Optional) by ref
***   Return: .T. or .F.
*****************************************************
LPARAMETER lcProgId,lcClassId, lcClassDescript

IF EMPTY(lcProgId)
   RETURN .F.
ENDIF

loAPI = CREATE("wwAPI")

*** Retrieve ClassId and Server Name
lcClassId =  ;
   loAPI.ReadRegistryString(HKEY_CLASSES_ROOT,;
                            lcProgId + "\CLSID",;
                            "")
IF ISNULL(lcClassId)
   lcClassId = ""
   lcClassDescription = ""
   RETURN .F.
ENDIF                                       
                            
lcClassDescript = ;
   loAPI.ReadRegistryString(HKEY_CLASSES_ROOT,;
                            lcProgId,"")

IF ISNULL(lcClassDescript)
   lcClassDescript = ""
ENDIF
                                    
RETURN .T.
You need can download a registry class used above from

http://www.west-wind.com/wwvfppd.htm

+++ Rick ---

>I need to write a routine to determine if a given activeX control is registered on the workstation. I am looking at the FFC--VCX: Registry; Class: Registry; Method: IsKey. I think this is the right place to start. I found the documentation on the VCX but I still have a few questions:
>
>1. Is "IsKey" the right method to use for determining whether a given activeX control is registered?
>
>2. If so, what values should the developer specify for cKeyName and nRegKey? Would cKeyName be the name of the OCX?
>
>After I get this working, the next step will be to register the OCX if it is not already registered, assuming the OCX file can be found.
>
>Thanks, Chaim
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform