Porting VB6 Add-on to .NET Add-Ins

229
3
09-07-2018 10:32 PM
HushamMohamed
Occasional Contributor

I am in process of converting an old VB6(ArcGIS 9.3) Add-on to .NET Add-Ins for ArcMap 10.6

the Add-on allows the user to Split or Merge road segments and adjusts their addresses accordingly.

The Old one contain:

1-  2 Forms:  Setup Form and the split Form.

2-  a Class Module that communicate between the forms and Error Handler Module.

Attaching  the class Module.

I have no idea on how to start this project,  I have no clear information of how to get the right solution

since I have snapping in the tool  and the way of the error handling.

My Question is Which approach should I follow,  Using Add-ins (is there any snapping limitation)  or use com.

for either way you advice:

1- what the steps I have to follow,  and how can I use the Error Handler.

2- what solution Template in VS 2017  should I use

Looking for any Help.   and  clsSplitroad code migration will be great help.

Thank you

0 Kudos
3 Replies
GintautasKmieliauskas
Regular Contributor

Hi,

Why do you need to convert VB6 code? It could be run and on ArcGIS 10.6. We are still using old VB6 code in our application as part of code. You just need to edit ArcMap.exe.config file. Open ArcMap.exe.config (it is located in the same folder as ArcMap.exe), locate libraries you use in your VB6 project. Edit bindingRedirect part of each library you use like this:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<dependentAssembly>

<assemblyIdentity name="ESRI.ArcGIS.AnalysisTools" culture="" publicKeyToken="8fc3cc631e44ad86"/>

<bindingRedirect oldVersion="9.3.0.0-10.6.0.0" newVersion="10.6.0.0"/>

</dependentAssembly>

</assemblyBinding>

0 Kudos
HushamMohamed
Occasional Contributor

Thank you Gintautas, 

We already did that,   it worked with some bugs,    another reason for migrating,   Our DB schema is changed little bit. so we have to make change accordingly in the code.

Thank you

0 Kudos
GintautasKmieliauskas
Regular Contributor

Hi Husham,

At first you need to install ArcObjects SDK 10.6.x on top of Visual Studio 2017. Open Visual Studio 2017. Select Project-New. In dialog select .Net Framework 4.5. Then go to Templates-ArcGIS-Desktop Add-ins-ArcMap Add-in. Alternative is to use Templates-ArcGIS-Extending ArcObjects-Class library (ArcMap). About differences you can read here: https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#25cf8397-3db8-4630-a3d3-f6147cf9f2f...