How To: Debug a Visual Basic ArcObjects ActiveX DLL application with Visual C++
To debug ArcObjects code written in Visual Basic, use either ESRI add-ins (ESRI ErrorHandler & ESRI Line Number Generator) or run their VB code in C++'s debugger.
More information about ESRI add-ins is available in the Utilities folder of ArcObjects Developer Help.
Follow these steps to use Visual C++ to debug a Visual Basic ActiveX DLL ArcObjects application.
NOTE: Steps 1-3 apply to the Visual Basic project; the remaining steps apply to Visual C++.
- In the Visual Basic ActiveX DLL project, click Project > Properties > Compile.
- Check Create Symbolic Debug Info.
- Click File > Make xxxx.dll, to recompile the DLL and create the PDB file.
- Start VC++. Close any open workspaces.
You must have Visual C++ installed in order to continue.
- Click File > Open and navigate to the Visual Basic class file (.cls) of your Visual Basic ActiveX DLL project.
- Press F5 to run the program (Build > Start Debug > Go).
- Click Yes to create a project.
- Click No; you do not want to create an EXE.
- Click Project > Settings > Debug.
- Click Category General. Set 'Executable for debug session' to ..\arcexe82\bin\ArcMap.exe.
- From the Category dropdown list, click Additional DLLs. Navigate to your Visual Basic DLL and click OK.
- Set break points in the code by going to the line where you want to start, and press F9.
- Press F5 to run the program.
- Check the box ..\arcgis\arcexe82\bin\ArcMap.exe and click OK.
- Press F10/F11 to step through the code.
When you step through the code and the debugger reaches a line that has a problem, it will not let you step over to the next line.
Article ID: 000005719
Software: ArcGIS - ArcEditor 8.1, 8.1.2, 8.2 ArcGIS - ArcInfo 8.0.1, 8.0.2, 8.1, 8.1.2, 8.2 ArcGIS - ArcView 8.1, 8.1.2, 8.2