Create an installation package for the ArcGIS DLL plug-in
08-08-26 09:19:32 mighty sky
Core tips:After compiling an ArcGIS extension DLL file, how can we load it to ArcGIS?ProgramMedium? This is very simple. It is nothing more than clicking "add from file" on the "Custom" panel.
After compiling an ArcGIS extension DLL file, how can we load it into the ArcGIS program? This is very simple. You just need to click the "add from file" command in the "Custom" Panel to import it. But if the class implements idockablewindowdef, We have to register it again in the component manager, this is very troublesome.
If you write a DLL on your own, this is not a great job, but if you develop a DLL for the customer, it is obvious that people will not accept this installation method, then, how to package a DLL into an installation package?
In fact, this problem is very simple. If the com DLL is to be called in the operating system, it must be registered in the registry. This process can be implemented using the regsvr32 command, however, if you use this method to register the DLL of ArcMAP, it will never appear in the command bar, toolbar, or floating form column of ArcMap. This is because the com class has been registered, but it is not added to the correct component type. Therefore, the add from file command does two things: 1. Call regsvr32 to register DLL 2. Add the class in DLL to the correct type. However, this command does not consider the idockablewindowdef type, so we have to manually add it once.
How can we automatically complete this process? It is not complicated. If you use a DLL written in VB, after writing it, click the ESRI compile and register command of the external program in VB6. A dialog box is displayed, we need to map the classes on the left to the correct type (in the right sidebar), and then click the compile button to generate a reg file while generating the DLL, let's take a look at the content of this file:
Regedit4
; This registry script enters coclasses into their appropriate component category
; Use this script during installation of the Components
;
; It also lists all coclasses contained within the DLL
; Coclass: nbgisdatatools. cdatatoolbar
; CLSID: {2ad16237-34b1-4bdd-85e7-bf4e0217915a}
; Component category: esri mx commandbars
[HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ CLSID \ {2ad16237-34b1-4bdd-85e7-bf4e0217915a} \ implemented categories \ {B56A7C4A-83D4-11D2-A2E9-080009B6F22B}]
; Coclass: nbgisdatatools. cdynamicdisplay
; CLSID: {13538a84-0856-4c07-8013-4539321d454e}
; Component category: esri mx commands
[HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ CLSID \ {13538a84-0856-4c07-8013-4539321d454e} \ implemented categories \ {B56A7C42-83D4-11D2-A2E9-080009B6F22B}]
This is a part of the file. Now we use regsvr32 to register the DLL, double-click the reg file, and open ArcMap. You will find the corresponding tool bar.
Or the command already appears.
Now that you know the registration process, it is easier to package it. Create a new project in InstallShield, add the DLL to be registered, and then import the reg file in the Regedit column, it is so easy.