viperpin sample DeveloperKit10.0

437
3
08-16-2011 06:42 AM
FrankVignati
Occasional Contributor II
for some reason i can not get the viperpin sample in the DeveloperKit10.0 sample to work in ArcMap 10
i opened the solution file in ms vb basic 2010 express and did a build on ViperPin2010 and registered the .dll from C:\Program Files\ArcGIS\DeveloperKit10.0\Samples\ArcObjectsNet\ViperPin\VBNet\bin\Release
when i go to arcmap and try to add a tool from file using the .dll it errors out with the message "can't load library from specified file"
i read on an earlier post that the .tlb file must be used for adding the tool and there were instructions for creating the .tlb file using vs 2008 express http://forums.arcgis.com/threads/34290-ViperPIN-sample-quot-Can-t-load-type-library-from-specified-f...

however the solution file will not open in vs 2008 returning a message that the solution file was made with a newer version of express, does anyone know how to create the .tlb file with ms vb 2010 express?
0 Kudos
3 Replies
EdgarBejarano
Occasional Contributor
frankv3,

Here are some things to consider that may help you overcome the issue.

1.  The ViperPin Developer Sample includes both VS2008 and VS2010 solutions so perhaps you can apply the .tlb instructions you mention that requires VS2008 by working with the ViperPin2008.sln instead of the ViperPin2010.sln.

2.  In the Customize dialog of ArcMap > Add From File, you specify the .tlb as instead of the .dll as you already discoverd.  I believe you can specify a .dll instead if it is a VB6 (native COM) dll.  For a .NET .dll (C# or VB.NET), specify the .tlb file.

3.  Attempt to bypass the Add From File with the .tlb file approach by seeing if you can register the ViperPin custom component by invoking ESRIRegAsm.exe in a command line,

e.g. command line syntax
"C:\Program Files\Common Files\ArcGIS\bin\EsriRegasm" /p:desktop "C:\myStuff\myProgram\Debug\Bin\myCustomComponent.dll"

You need only change the string in the pathname to the DLL and the DLL name itself.  More about ESRIRegAsm:
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/ESRIRegAsm_utility/0001...

Note, when you register a custom component using the Customize dialog, you are technically invoking the ESRIRegAsm utility behind the scenes.  All ArcGIS Desktop 10 machines should have ESRIRegAsm in the C:\Program Files\Common Files\ArcGIS\bin folder.  It installs there with the installation of ArcGIS Desktop 10.

Once it registers successfully with ESRIRegAsm by command line, you will see a Registration Succeeded message box.
0 Kudos
FrankVignati
Occasional Contributor II
thanks
i tried using the 08 solution file in vs 2008 also with no success in making the tlb file even after registering it manually at the command line with "C:\Program Files\Common Files\ArcGIS\bin\EsriRegasm" there is no tlb file even though it reported back that it was registered successfully
do you know where to set the  'register for COM Interop' option in either 2010 or 2008 express?
0 Kudos
EdgarBejarano
Occasional Contributor
frankv3,


1.  "even after registering it manually at the command line with "C:\Program Files\Common Files\ArcGIS\bin\EsriRegasm" there is no tlb file even though it reported back that it was registered successfully"

= Registering the custom component DLL file manually with ESRIRegAsm at a command line achieves the task of actually registering the custom component.  It does not produce the TLB file that you are looking for.  I use that approach as an alternative to the Customize dialog/TLB file approach.  Also, as far as I know, you do not need the TLB to be produced in order to invoke ESRIRegAsm.  In fact, I just quickly tested this assumption by deleting my TLB before registering a .NET DLL with ESRIRegAsm, and my custom tool registered successfully.

2.  "[ESRIRegAsm at the command line] reported back that it was registered successfully"

= It sounds like the custom command (ViperPin tool) has registered successfully.  Does it not appear as a command in the category specified in the code (Developer Samples category)?  It may already be registered and ready to be dragged onto a toolbar.

3.  The Register for COM Interop is a checkbox in the following location:
Right-click on project in the Solution Explorer > Properties option > Compile (or Build) tab.
You should see the checkbox.  I believe an express version of either VS2008 or VS2010 should have that checkbox in that location.  However, it should already be checked for the ViperPin tool project.  It would only be unchecked if you unchecked it yourself.
0 Kudos