1

I am writing a plugin for the AIMP music player, which is itself closed source but has documentation for adding plugins. The interface is available in Delphi, hence I am figuring out how to use RAD Studio Delphi 10.3 Community Edition.

I have stumbled upon a situation that is either of these:

  • Something is wrong with how I call the AIMP Methods or how I set up the parameters
  • Something is wrong with the Method I am calling

I have set up the Run Parameters so that the AIMP Program is actually launched when I press "Run". I have also enabled Tools > Options > Debugger > Embarcadero Debuggers > Debug spawned processes. However, the program did not stop at my breakpoint and there was a grey X icon displayed in front of the breakpoint.

Turns out this was because I also had a version of the compiled dll in the AIMP Plugin directory so it was loading that old version and not my newly compiled one. But even when I remove the old version... how can I get it to actually call the new version? When I build my dll and paste it into AIMP's Plugin directory, it will be loaded and the settings screen reflects that. I can even show a Message Box when the settings are being modified by the user. But copying the dll over means I can't stop at breakpoints.

How can I make the debugger stop at my breakpoint so that I can step through the program, ideally being able to see the values of local variables?

lucidbrot
  • 5,378
  • 3
  • 39
  • 68
  • 1
    Are you using a post build event to copy the DLL to the AIMP Plugin directory? – Brian Sep 03 '20 at 20:09
  • @Brian No, so far I am manually moving it, which does not work. I also just found [this related comment](https://stackoverflow.com/questions/594253/how-to-debug-a-dll-file-in-delphi#comment407824_594293). Where would I find the relevant settings? – lucidbrot Sep 03 '20 at 20:10
  • [Found it](http://docwiki.embarcadero.com/RADStudio/Rio/en/Creating_Build_Events). I'll give it a try – lucidbrot Sep 03 '20 at 20:14
  • 3
    You can set the output directory to compile it to that final location as well (Project -> Options -> Delphi -> Output Directory). Make sure you test it is ending up where you want as there are so many spots to place a value and some don't seem to work. – Brian Sep 03 '20 at 20:16
  • @Brian your second comment did the trick! Thank you. The post-build event I set up after your initial comment only copied some other file or gave it the wrong ending, so I decided to first try that `Output Directory` setting and that works. If you write it as an answer, I'll accept :) – lucidbrot Sep 03 '20 at 20:21

1 Answers1

2

Under Project > Options > Building > Delphi Compiler there is the option Output directory. Setting this path for the relevant Build Configurations to the AIMP Plugin directory did the trick, as suggested by @Brian in this comment. Screenshot of project options

lucidbrot
  • 5,378
  • 3
  • 39
  • 68