You are here: Start » Extensibility » Debugging User Filters

Debugging User Filters

Debugging User Filters with FabImage Studio Running

To debug your user filters, follow the instructions below:

  1. If the Microsoft 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\FabImage 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 FabImage 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 FabImage 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 FabImage Studio. At this point it should get you into the debugging session.

Debugging User Filters by attaching to FabImage Studio process

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

  1. Run FabImage Studio and load your project.
  2. Load solution of the User Filter in Microsoft Visual Studio.
  3. From the Debug menu, choose Attach to Process.
  4. In the Attach to Process dialog box, find FabImageStudio.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 FabImage Studio. At this point it should get you into the debugging session.

Debugging Tips

  • User filters have access to the Console window of FabImage Studio. It can be helpful during debugging user filters. To write on the Console, please use one of the functions below:
    • bool LogInfo (const ftl::String& message);
      
    • bool LogWarning (const ftl::String& message);
      
    • bool LogError (const ftl::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