Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
375 ratings:
 3.59 out of 5   

How Do I Register ActiveX Controls, ActiveX Servers, and Type Libraries?

Primary Software: Measurement Studio>>Measurement Studio for Visual Basic 6
Primary Software Version: 2012
Primary Software Fixed Version: N/A
Secondary Software: N/A

How do I manually register ActiveX controls (.OCX), ActiveX servers (.DLL and .EXE), and type libraries (.TLB) on my computer?


ActiveX Controls
ActiveX controls are files with a .OCX extension. These controls come in 16-bit and 32-bit forms, with 32-bit being the most common. To register an ActiveX control, you should use Regsvr32.exe as follows:
  1. Select Start»Run.
  2. Type the following in the dialog box that appears:
    regsvr32 "<Full path of .OCX file>"
    where "<Full path of .OCX file>" is the location of your ActiveX control including the quotes. The image below shows an example of registering mswinsck.ocx, which you will need to replace with the file path and name of the ActiveX Control you want to register:

Note: If you have a 16-bit control, you should run Regsvr instead of Regsvr32. If your ActiveX control is registered incorrectly, you must first unregister it and then register it again.

Note: If you have a 64-bit Windows, there is a 32-bit version of Regsrv32 and a 64-bit version of Regsrv32. The 64-bit version of Regsrv is in the System32 folder, while the 32-bit version is in the SysWOW64 folder. By default, the 64-bit version of Regsrv will run. For more information, please see this Microsoft Support article about the 64-bit Regsrv.  

You will get a dialog box prompting you that your control has been unregistered or registered successfully. To unregister a control, use the switch /u as part of the command. For example:
regsvr32 /u "<Full path of .OCX file>"

ActiveX Servers
ActiveX servers can be in the form of dynamic link libraries (.DLLs) and executables (.EXEs). DLLs are registered like an ActiveX control with regsvr32 as in the previous section. However, when registering an .EXE, you must use call the .EXE file with the switch /RegServer as follows:

  1. Select Start»Run.
  2. Type the following in the dialog box that appears:
    <Full path of the .EXE file> /RegServer
    where <Full path of the EXE file> is the location of your EXE server. For example:
    C:\TestStand\Bin\REngine.exe /RegServer
To unregister an EXE ActiveX Server use the switch /UnRegServerFor example:

For more information about ActiveX Servers, please see this Microsoft Support article about registering and unregistering ActiveX Servers.

Type Libraries
Type libraries (.TLB) are binary files that contain all of the type information needed to utilize the procedures and classes in a .DLL. To register a type library, you should use regtlibv12.exe (formerly regtlib.exe). Follow these steps to use regtlibv12.exe
  1. Navigate to the following folder and copy the file path to clipboard: 

    Note: In some situations, such as on newer versions of Windows, you may not have regtlibv12.exe on your system. If you do not have regtlibv12.exe on your system, you can instead use Regasm.exe.  Information about this tool can be found on Microsoft's website at the following link: Microsoft Developer Network Regasm.exe (Assembly Registration Tool).

    Note: The actual folder path may be different depending on the .NET Framework version installed on your computer. This may also be located in C:\WINDOWS\system32\URTTemp\regtlib.exe  
  2. Select Start»Run.
  3. Type the full location of this executable into the box that appears such as: 
     "<Full path of .TLB file>
    where "<Full path of .TLB file>" is the location of your type library file with quotations.
  4. Click OK.

Related Links:
External Link: Microsoft Support: How to register an ActiveX control (.ocx) manually
External Link: Microsoft Support: How to register an ActiveX control manually (.ocx)
External Link: Microsoft Support: Error Message When You Regsrve.exe on 64-bit Windows
External Link: Microsoft Support: How to Register and Unregister an Out-Of-Process COM Component (ActiveX exe)
External Link: Microsoft Developer Network: Regasm.exe (Assembly Registration Tool)
KnowledgeBase 2XDAB1SJ. Why Does regsvr32.exe Register my .ocx File From the Incorrect Directory?
KnowledgeBase 417EP44G: How Do I Use an OCX File in LabVIEW?


Report Date: 01/12/1999
Last Updated: 11/19/2016
Document ID: 1HBAMMSR

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit