Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Register Activex on the fly at run time
Message
From
18/07/1999 22:16:05
 
 
To
18/07/1999 21:35:28
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00242930
Message ID:
00242937
Views:
15
>I need to add an Activex control to one of my apps that is installed on lots of client machines. Is there a way to register the control on the fly at run time so I can avoid re-installing the app with a setup program on all of the machines? I don't care if the registration is permanent or just while the app runs.
>

If you know where the files is located, and you're fairly certain that all dependencies have been satisified, there are at least two ways to do this - run REGSVR32 against it using VFP's native RUN command (I'd suggest adding the /S parameter to the command line), or under VFP 6, with the FFC ShellExecute() class, or an add-on class like my API_APPRUN class downloadable from the Files Section here on UT.

Alternatively, with a small amount of coding, you can also call the self-registration ejtrypoints for the component programmatically through calls to the OCX/DLL's self-registration code. There is sample code in the FAQ that could be adapted to this if you don't want to rely on REGSVR32 to do this, but you'll have to get the code written correctly for the control, since at a minimum, the DECLARE...DLL statements needed for the call are case-sensitive.

In any case, I'd make certain that all dependencies for the control are properly satisifed before attempting to register the control either way. A missing component, or failing to register a dependent componet before registering the control itself will make registration fail. Check the vendor documentation thoroughly to make sure you understand what needs to be present. You migth be better off building an installation routine that handles both copying the control in place and making sure that the necessary componets are present; in most cases, you can call an installation program the same way you'd call REGSVR32.
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