Debugging Visual Basic ActiveX DLL or EXE Called by TestStand

Updated Aug 20, 2021

Environment

Software

  • Automation Toolkit for Visual Basic
  • TestStand

If you have created a Visual Basic ActiveX DLL or EXE, you may call this code from TestStand using the ActiveX Automation Adapter. For more information about calling Visual Basic code from TestStand, refer to the example below for a Simple VB ActiveX DLL. Since you cannot directly step into this code from TestStand, you must configure your Visual Basic project to launch TestStand as an external program when you execute your Visual Basic application. Once you start TestStand, you can execute the sequence containing the step you wish to debug. When that step is executed, any breakpoints that you have set inside of the Visual Basic project will be honored once the code containing the breakpoint is executed.

Note: This debugging option is only available for ActiveX Executables and ActiveX DLLs.

Follow the steps below to change the properties of your Visual Basic project so that TestStand launches as an external program:
  1. From the menu bar, select Project»<Project Name> Properties
 
  1. On the Project Properties dialog box that appears select the Debugging tab.
  2. Enable the option Start program: and enter the path of the sequence editor executable. For example, <TestStand>\Bin\SeqEdit.Exe.
  3. Select OK to close the Project Properties dialog box.
 
  1. Place breakpoints within your project at points where you want to pause the execution.
  2. To begin debugging, press <F5> or click the Run button on the toolbar within Visual Basic to start your application. This also launches the TestStand Sequence Editor.
  3. Using the TestStand Sequence Editor, open the sequence that contains the step that is configured to call the Visual Basic ActiveX Server you want to debug.
  4. Once you have opened the sequence, place a breakpoint on the step(s) you wish to debug. When you execute your sequence, you can now step into your Visual Basic code using the TestStand debugging features on the toolbar of the sequence editor.