Select to view content in your preferred language

Custom extensions

7027
54
Jump to solution
10-23-2009 06:56 AM
by Anonymous User
Not applicable
Original User: 164549

None of my custom developed extensions are showing up under Customize->Extensions, yet all the ESRI extensions are there.  Is there some new development process or different setting needed to make them show up?
0 Kudos
54 Replies
RalfGottschalk
Esri Contributor
Mark,

The instructions provided in the KB document for using a reg file will not work with Pre-Release.  You will have to manually create the XML file like in the 3rd step.  The reg file functionality was included at 10.0 final.
0 Kudos
by Anonymous User
Not applicable
Original User: jnaveen

Sorry. Again invalid question and hence removed my own question.
0 Kudos
sirishapolsapalli
Deactivated User
It appears to me that when you run the ESRIRegAsm tool that it produces a file in the following directory:

C:\Program Files\Common Files\ArcGIS\Desktop9.4\Configuration\CATID

The name of the file is something like {GUID}_name.ecfg.  The file itself is really a zip file which contains a file named config.xml.  It appears that ArcMap is using this file to determine component categories versus that which is in the registry.

I did the following:

1) Used the VB6 sample which has a tool bar, extension, and zoom in and out commands and built the DLL and reg file needed on a 9.3.1 system
2) Tested the sample on 9.3.1; no problems
3) Tested the sample on 9.4 using ESRIRegAsm; it does not work
4) Went to the CATID directory, extracted the config.xml, manually repaired the XML, and put it back in the zip
5) Tested the sample, no problems

ESRI, why don't you provide a trivial tool which does this?



Hi Can you please tell me what is that you manually repaired in the XML. I am having the same problem. And when I look into the CATID directory I noticed the CLSID values dont match the values from the component catergories. I modified the values in the config.xml to match the Component Categories and tried to execute ESRIRegAsm using the syntax
ESRIRegAsm /p:Desktop "MyDLL.dll" /f:"Config.dll" but didnt work.
Thanks,
Sirisha.
0 Kudos
sirishapolsapalli
Deactivated User
Hi Can you please tell me what is that you manually repaired in the XML. I am having the same problem. And when I look into the CATID directory I noticed the CLSID values dont match the values from the component catergories. I modified the values in the config.xml to match the Component Categories and tried to execute ESRIRegAsm using the syntax
ESRIRegAsm /p:Desktop "MyDLL.dll" /f:"Config.dll" but didnt work.
Thanks,
Sirisha.


The following solution works for me now with ArcGIS 10 and Windows 7:
ESRIRegAsm /p:Desktop "MyDLL.dll" /f:"Config.dll"
The same however didnt work with ArcGIS 10 pre-release.
And the command prompt when running ESRIRegAsm should be run as an administrator in Windows Vista and Windows 7.

Thank you,
Sirisha.
The Omega Group
San Diego
0 Kudos
by Anonymous User
Not applicable
Original User: warpengine

So let me get this straight after reading the tech article.

I have a VB6 DLL that I compile against the 10.0 framework. Then I take the ESRIRegAsm tool against my reg file to create a ecfg file.

To deploy I copy the DLL to a location of my choosing, then I copy the ecfg file to %CommonProgramFiles%\ArcGIS\Desktop10.0\Configuration\CATID and finally I still use regsvr32 to register the DLL.

Did I get that all correct?

AGP
0 Kudos
RalfGottschalk
Esri Contributor
Hi Able,

I just want to be clear, so sorry for the longwinded answer.

The major change that affects people who are building customizations for Desktop at 10 is that these customizations are no longer loaded through component categories in the registry, but instead through product specific configuration files (ecfg).  The point of the article is to say that if you have an existing dll that always �??just worked�?� and you want to try it in 10 �??as is�?� then here is how you can create an ecfg file for that dll.  Try it, if it works, great!

There is a good chance that if you just create the proper ecfg file, it might just work.  (No guarantees)  If it does work we still recommend that you recompile, but at least for now things are working, and you can spend more time on your migration process.  If you built your dll in VB6, please migrate to a supported development language.  If you built it in any other language recompile and certify.  If it doesn�??t work or have problems, then you must recompile.

The deployment mechanism is the same for dlls that are compiled at the current release or older ones.  The only additional step you have to do in 10 is that your setup program needs to put the ecfg file in the right spot on the target machine.

So in your situation, you could try to use the VB6 dll without recompiling against 10.  Or you could compile your VB6 dll against 10.  (Either way this would not be supported, because at 10 VB6 is not longer supported).  Then you would run ESRIRegAsm against your reg file to create an ecfg file.

To deploy you can deploy like you always have done.  Since it is a VB6 dll and VB6 dlls do not support category registration, you might have used a reg file to register the dll and category information.  You could use regsvr32 to register the dll, or you could use this same reg file to register the dll, but you don�??t need the category information in the reg file, that is all in the ecfg file, which you copy over to the CATID folder. 

Hope this helps.
0 Kudos
by Anonymous User
Not applicable
Original User: bFlood

hi ralfg

is there anything machine specific in the ecfg file or could you generate it once for your extension and then just place that file your installer (and install it in the proper CATID folder). Is this better or worse then just running ESRIRegAsm on every machine during the install process?

thanks
brian
0 Kudos
RalfGottschalk
Esri Contributor
Hey Brian,

There is nothing machine specific in the ecfg, so you could create the ecfg file on your development machine and as long as it is deployed into the proper CATID folder on the target machine it will work.  You still have to register the dll on that machine, but you could use a reg file for this.  That way you can avoid calling ESRIRegAsm, Regasm, or regsvr32 altogether in your setup.
0 Kudos
by Anonymous User
Not applicable
Original User: cheynm

These techniques are working for me with the release version, thanks Ralf.

Thinking ahead to new ArcGIS 10 extensions we will make, which thankfully won't require COM registration, always a headache as it requires elevated privs, there is still a snarl under the new scheme -

Is there any other location besides C:\Program Files\Common Files\ArcGIS\Desktop10.0\Configuration\CATID where *.ecfg files can be placed?

That location requires elevated privs.
0 Kudos
markcheyne
Deactivated User
This is in answer to Thomas York's question above, post #35.

This is how to use VB6 to bind to an ArcGIS version.

Thomas correctly identified the necessary DLL to reference (c:\program files\common files\arcgis\bin\arcgisversion.dll), but when you use the VB6 Object Browser to examine the classes in that library, you'll see that the appropriate class name is different from that seen in the .NET examples on this subject.

You need to instantiate a VersionManager object as type IArcGISVersion, and call its LoadVersion() method. You might want to see http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000nmm000000 for a C++ example.

Something along these lines:


Private Sub btnTest_Click()
  On Error GoTo EH
  
  Dim vok As Boolean
  Dim lok As Boolean
  
  'bind to an ArcGIS 10 version:
  Dim version As String
  version = "10.0"
  Dim vmgr As ArcGISVersionLib.IArcGISVersion
  Set vmgr = New ArcGISVersionLib.VersionManager
  vok = vmgr.LoadVersion(esriArcGISDesktop, "10.0")
  If Not vok Then
    Err.Raise 1, , "Unable to bind to ArcGIS version " & version
  End If
  
  'now get a license:
  Dim ao As esriSystem.IAoInitialize
  Set ao = New esriSystem.AoInitialize
  lok = True
  If (ao.IsProductCodeAvailable(esriLicenseProductCodeArcInfo) = esriLicenseAvailable) Then
    ao.Initialize esriLicenseProductCodeArcInfo
  Else
    lok = False
    Err.Raise 2, , "Unable to get an ArcGIS Desktop license."
  End If
  
  'report results:
  MsgBox "Bound to ArcGIS 10: " & vok & vbCrLf & "Got a license: " & lok

ExitSub:
  Exit Sub
  
EH:
  MsgBox Err.Description
  Resume ExitSub
End Sub
0 Kudos