You are currently offline, waiting for your internet to reconnect

Your browser is out-of-date

You need to update your browser to use the site.

Update to the latest version of Internet Explorer

How to register an ActiveX control (.ocx) manually

This article was previously published under Q146219
SUMMARY
When you distribute a Microsoft Visual FoxPro application that uses an ActiveXcontrol (.ocx file), the .ocx file must be registered correctly for it towork 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 filecorrectly, 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 isdistributed by some other method, the .ocx file must be registered manually.This article describes how to register an .ocx file manually.
MORE INFORMATION
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.0and 3.0b, Regsvr32.exe is located in the \Vfp\Samples\Ole directory, and inVisual FoxPro 5.0, Regsvr32.exe is located in the \Vfp directory. In VisualFoxPro 6.0, Regsvr32.exe is found in the Distrib.src directory of theVisual FoxPro directory. It may be distributed with a Visual FoxProapplication. The syntax for using Regsvr32.exe is as follows:
   Regsvr32 [/u] [/s] <OCX File Name>					
Note /u means Unregister the .ocx file.
/s means Silent Mode (display no messages).

The following example registers the Microsoft MAPI ActiveX Controlwithout displaying any messages:
   Regsvr32 /s MSMAPI32.OCX				
To implement this example in a Visual FoxPro application, use the RUNcommand as follows:
   RUN /N Regsvr32 /s MSMAPI32.OCX				
Note If an error occurs when registering a control, do thefollowing:
  1. Verify in the Registry that the control has not been registered before.
  2. Verify that the following files are in the Windows\System directory:
          mfc30.dll     olepro32.dll     msvcrt20.dll      mfc40.dll     msvcrt40.dll
    If one of these files is missing, you may receive the following error message:
    Error: OLE Error Code 0x80040112: Appropriate license for this class not found.
Properties

Article ID: 146219 - Last Review: 09/17/2011 08:59:00 - Revision: 6.0

  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft Visual FoxPro 5.0 Standard Edition
  • Microsoft Visual FoxPro 6.0 Professional Edition
  • Microsoft Visual FoxPro 7.0 Professional Edition
  • Microsoft Visual FoxPro 9.0 Professional Edition
  • kbautomation kbhowto kbinterop KB146219
Feedback