Thursday, April 28, 2011

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

The following commands may be needed in the case of installing multiple NAV Service Tiers in single Server. For example, when you are in need of installing NAV 2009 SP1 and NAV 2009 R2 in the same server, the second instance needs to be installed and registered in the Windows Registry using below commands

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
Where 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 This could also be a OCX file

Where 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 ).

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:
/RegServer

Where 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.

You may also try below commands in the case of an eror in the above commands for registering required DLL files,

Examples:

c:\Windows\system32>
gacutil/i "C:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Dynamics Online Payment Client\Microsoft.Dynamics.NAV.DO.ClientProxyWrapper.dll"

C:\windows\microsoft.net\framework\v4.0.30319\regasm /codebase /tlb:Microsoft.Navision.Mail.tlb Microsoft.Navision.Mail.dll

c:\windows\microsoft.net\framework\v2.0.50727\regasm /unregister /tlb:microsoft.navision.mail.tlb microsoft.navision.mail.dll

C:\windows\microsoft.net\framework\v2.0.50727\regasm /codebase /tlb:Microsoft.Navision.Mail.tlb Microsoft.Navision.Mail.dll

No comments:

Post a Comment

Business Central SaaS Extension Design: Implementing Plant Tracking with AL Event Subscribers

  Extending Business Central SaaS: Plant Tracking Using AL Extensions  1️⃣ Problem Statement In many manufacturing and service-oriented or...