Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I know which OCXs have been installed
Message
From
19/12/1999 22:10:17
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00305915
Message ID:
00305969
Views:
38
>>>You can look in the registry for the key HKEY_CLASSES_ROOT\ProgID to see whether or not a given control is currently installed and registered. You can look for the CLSID if you don't know the ProgID; it'll be encapulated in {}, under the key HKWY_CLASSES_ROOT\{CLSID}
>>
>>How can I know what the ProgID or CLSID should be before installing a control?
>>
>>Sorry Ed but this looks a little bit obscure to me. Can you help me out on this? I don't want to waste your time over this so if there is a place where I could get more informations on these issues you can save time by telling to me where to look for.
>>
>>If you feel courageous enough to guide me through this go for it.
>
>All COM components store information about themselves in the registry, under the root key HKEY_CLASSES_ROOT. During the process of registration, entries are written for the COM components (ActiveX controls are COM components) to store information about them, at a minimum, the CLSID which uniquely identifies a given version of a control, and usually a ProgID, a human-readable name associated with the component so that you can refer to in more understandably when creating it. The CLSID data is stored under HKEY_CLASSES_ROOT\{CLSID}. and the ProgID data under HKEY_CLASSES_ROOT\ProgID. You can get the CLSID and ProgID for a control using any of several object viewers like the Component Gallery in VFP, or OLEView or VB's Object Browsers. If you've dropped a control on a form, you can look at the Control's ProgID in the Property Sheet there, too in the OleClass property
>
>You can use the Win32 API or an ActiveX control to check if a registry key exists. If you have VFP6, there is a registry class in the FFC; earlier versions of VFP will need to download one of the registry classes from the FIles Section. The Windows Scripting Host's Wscript.Shell also has methods for handling the registry.
>
>Using the FFC registry class, here's how I'd check to see if Eds.SillyControl was registered on the system:
>
>
* this assumes you have the REGISTRY.VCX, .VCT and .H from the FFC directory of VFP6
>*
>#INCLUDE REGISTRY.H
>LOCAL oReg
>oReg = NEWOBJECT('Registry','Registry.VCX')
>IF oReg.IsKey('Eds.SillyControl',HKEY_CLASSES_ROOT)
>   *  It's there, so it's registered
>ELSE
>   *  it isn't registered
>ENDIF
>oReg = NULL
>
>Can't get too much easier than that!


Thank you very much Ed!
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Reply
Map
View

Click here to load this message in the networking platform