Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

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

- National Instruments

http://digital.ni.com/public.nsf/allkb/4F811A9B23F1D46E862566F700615B7A?OpenDocument

Improve your ni.com experience. Login or Create a user profile.

254 ratings:

4.31 out of 5

Rate this Document

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


Primary Software: Measurement Studio>>Measurement Studio for Visual Basic 6 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 (.DLL and .EXE)? Solution: Type Libraries Type libraries 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 regtlib.exe as follows: 1. Navigate to the following folder and copy the file path to clipboard: C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe (the actual folder path may be different depending on the .NET Framework version installed on your computer.) Note : 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.

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.

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. 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 (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 (C:\TestStand \Bin\REngine.exe /RegServer).

To unregister an EXE ActiveX Server use the switch /UnRegServer (C:\TestStand \Bin\REngine.exe /UnRegServer). 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. Related Links: Common Controls Replacement Project 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? Attachments:

Report Date: 01/12/1999 Last Updated: 12/27/2011 Document ID: 1HBAMMSR


Your Feedback! Document Quality? 1 2 3 4 5 Poor | Excellent Answered Your Question? Yes No

Please Contact NI for all product and support inquiries.

My Profile | RSS | Privacy | Legal | Contact NI

1 of 2

1/13/2012 2:45 PM

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

http://digital.ni.com/public.nsf/allkb/4F811A9B23F1D46E862566F700615B7A?OpenDocument

2011 National Instruments Corporation. All rights reserved. | E-Mail this Page

2 of 2

1/13/2012 2:45 PM

You might also like