Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ActiveX question?
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00238864
Message ID:
00239036
Views:
13
>>>>Just wondering if any one know if there is a way to determine the version# of an activeX control programatically in VFP. i.e. I want to find out the version# of the calendar control at run time...
>>>>
>>>>Any help is appreciated !!!
>>>>
>>>>Thanks.
>>>
>>>If you know the name and location of the OCX file, all you have to do is pass it, along with an array to AGETFILEVERSION() (or GetFileVersion() in foxtools for VFP 5.0). The fourth array element will contain the version.
>>
>>George, that's great where you're certain that you're pointed to the right .OCX, but because of the 'last man standing wins' approach to registration, it's safer to look in the registry - your original OCX may be present on the system, but another app may have registered a different version in a different directory, or with a different file name, that usurps the ProgID and CLSID registry keys that are used to determine which control instance is being loaded. If you're working with a VersionIndependentProgID (ie Visual.FoxPro.Application, as opposed to the version-specific ProgIDs VisualFoxPro.Application.5 and VisualFoxPro.Application.6) it's even more likely that you're going to get bitten by looking at the OCX...
>
>Hi Ed,
>
>Very true, but I think that it's more of a reason to sub-class the control.

Or better yet, don't add the control to the form at Design time in the first place! Add the control at runtime using the ProgID (easiest if you instantiate a non-visual class to wrap the ActiveX control on the parent container (form, page, whatever)), so that you don't care which one is present as long as more recent versions support the same functionality that the older version did!
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform