Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
210 ratings:
 4.55 out of 5     Rate this Document

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

Primary Software: Measurement Studio>>Visual Basic Support
Primary Software Version: 3.0.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
How do I manually register type libraries (.tlb), ActiveX controls (.ocx), and ActiveX servers?

Solution:

Type Libraries
Type libraries are binary files that contain all type information needed to utilize procedures and classes in a DLL. To register a type library, you can use regtlib.exe as follows:

  1. Select Start » Run.

  2. Type the following in the dialog box that appears:
    C:\WINDOWS\system32\URTTemp\regtlib.exe  <Full path of .tlb file>
    Where <Full path of .tlb file> is the location of your type library file.

ActiveX Controls
ActiveX controls are files with a .ocx extension. These controls come in 16-bit as well as 32-bit forms, with 32-bit being the most predominant. To register an ActiveX control, you can 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.
If you have a 16-bit control, you can run regsvr instead of regsvr32. If your ActiveX control is registered incorrectly, you must first unregister it and then register it again. In both cases, 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 (i.e., regsvr32 /u <Full path of .ocx file>).

Note: For a complete listing of the switches available, just type regsvr32 from the Start » Run dialog box.

ActiveX Servers
ActiveX servers can be in the form of both DLLs and executables (EXEs). DLLs can be registered similar to an ActiveX control (e.g., regsvr32 C:\Teststand\BIN\TEAPI.DLL). However, when registering an EXE, you must use 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 (e.g., C:\TestStand\Bin\REngine.exe /RegServer).
In the same manner, to unregister an EXE ActiveX Server use the switch /UnRegServer (e.g., C:\TestStand\Bin\REngine.exe /UnRegServer). RegServer and UnRegServer are switches whose functionality is built into the executable.

Note: If you find that you are dealing extensively with Type Libraries, ActiveX Controls, and ActiveX Servers, you may find the utility linked below useful. It is a very simple utility that allows you to quickly register and unregister Type Libraries, ActiveX Controls, and ActiveX Servers. The application is distributed freely by the Common Controls Replacement Project (CCRP), and the readme file included with the application explains how to use it. Also refer to KB 2XDAB1SJ for more inofrmation about .ocx files (linked below).


Related Links:
Common Controls Replacement Project
KnowledgeBase 2XDAB1SJ. Why Does regsvr32.exe Register my .ocx File From the Incorrect Directory?

Attachments:


Registration Utility.zip


Report Date: 01/12/1999
Last Updated: 10/02/2009
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