You are here: Start » Extensibility » Debugging User Filters

Debugging User Filters

Debugging User Filters with Adaptive Vision Studio Running

To debug your user filters, follow the instructions below:

  1. If the Visual Studio solution of your user filter library is not opened, open it manually. For global user filters it is typically located in My Documents\Adaptive Vision Studio Professional\Sources\LibraryName, but can be located in any other location that you have chosen while creating the library. For local user filters, you can check the location of the solution file in the Project Explorer task pane.
  2. Make sure that Adaptive Vision Studio is not running.
  3. Select Debug configuration.
  4. Go to the project properties:
  5. Go to Debugging section:
  6. Set Command to the executable of Adaptive Vision Studio.
  7. Set Debugger Type to Native Only.
  8. Set a breakpoint in your code.
  9. Launch debugging by clicking F5.
  10. Have your filter executed in Adaptive Vision Studio. At this point it should get you into the debugging session.

Debugging User Filters by attaching to Adaptive Vision Studio process

You can attach the Visual Studio debugger to a running process. Follow the instructions below:

  1. Run Adaptive Vision Studio and load your project.
  2. Load solution of the User Filter in Visual Studio.
  3. From the Debug menu, choose Attach to Process.
  4. In the Attach to Process dialog box, find AdaptiveVisionStudio.exe process from the Available Processes list.
  5. In the Attach to box, make sure Native code option is selected.
  6. Press Attach button.
  7. Set a breakpoint in your code.
  8. Have your filter executed in Adaptive Vision Studio. At this point it should get you into the debugging session.

Debugging Tips

  • User filters have access to the Console window of Adaptive Vision Studio. It can be helpful during debugging user filters. To write on the Console, please use one of the functions below:
    • bool LogInfo (const atl::String& message);
      
    • bool LogWarning (const atl::String& message);
      
    • bool LogError (const atl::String& message);
      
    Functions are declared (indirectly) in the UserFilter.h header file that should be used in every file with user filters source code.
  • To write messages on the Output window of the Microsoft Visual Studio, please use standard OutputDebugString function (declared in Windows.h).
Previous: Creating User Filters Next: Creating User Types