Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
How to register an ActiveX control (.ocx) manually
Article ID: 146219 - View products that this article applies to.
This article was previously published under Q146219
When you distribute a Microsoft Visual FoxPro application that uses an ActiveX control (.ocx file), the .ocx file must be registered correctly for it to work correctly. The Visual FoxPro Setup Wizard or InstallShield Express in Visual FoxPro 7.0 or a later version of Visual FoxPro will register an .ocx file correctly, provided that you select the OLE check box in Step 6 for the .ocx file. If a Visual FoxPro application that uses an .ocx file is distributed by some other method, the .ocx file must be registered manually. This article describes how to register an .ocx file manually.
You can use the Microsoft Register Server (Regsvr32.exe) to register a 32- bit .ocx file manually on a 32-bit operating system. In Visual FoxPro 3.0 and 3.0b, Regsvr32.exe is located in the \Vfp\Samples\Ole directory, and in Visual FoxPro 5.0, Regsvr32.exe is located in the \Vfp directory. In Visual FoxPro 6.0, Regsvr32.exe is found in the Distrib.src directory of the Visual FoxPro directory. It may be distributed with a Visual FoxPro application. The syntax for using Regsvr32.exe is as follows:
Note /u means Unregister the .ocx file.
/s means Silent Mode (display no messages).
The following example registers the Microsoft MAPI ActiveX Control without displaying any messages:
To implement this example in a Visual FoxPro application, use the RUN command as follows:
Regsvr32 /s MSMAPI32.OCX
Note If an error occurs when registering a control, do the following:
RUN /N Regsvr32 /s MSMAPI32.OCX
Article ID: 146219 - Last Review: September 17, 2011 - Revision: 6.0