How to use Mix_HookMusicFinished

Help
2005-01-10
2013-05-08
  • Julian Becker
    Julian Becker
    2005-01-10

    In the original documentation of SDL it reads that Mix_HookMusicFinished points to a void function so in Pascal that would mean a funtion.#

    Now when I try this code using Delphi I run into a crash:

    procedure MusicFinished;

    begin
    ShowMessage('finished');
    end;

    procedure Play(file:string);

    begin
    [...]
    Mix_HookMusicFinished(@MusicFinished);
    [...]
    end;

    This code compiles well and the song is played perfectly but after playing the program gets an exception error and crashes. How do I use this command? thanks