Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
358 ratings:
 3.61 out of 5     Rate this Document

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

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

Solution:

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 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. 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 /UnRegServer. For example:
C:\TestStand\Bin\REngine.exe
/UnRegServer

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: 
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe
     
    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: 
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe
     "<Full path of .TLB file>
    where "<Full path of .TLB file>" is the location of your type library file with quotations.
  4. Click OK.
 

For installing Type Libraries, there is also the Regasm.exe (Assembly Registration Tool). Information about this tool can be found here at Microsoft Developer Network Regasm.exe (Assembly Registration Tool).



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?
External Link: Common Controls Replacement Project

Attachments:





Report Date: 01/12/1999
Last Updated: 08/28/2014
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