MrPuzzled
25th April 2002, 06:06
Hi,
I've been communicationg with Winamp 2.7 using the Winamp api and Delphi. Everything has worked ok, apart from one call, 211, getting the filename of a track in the playlist.
My code looks like this:
var
PC : PChar;
Index : Integer;
begin
Index := 0;
PC := PChar(SendMessage(hwnd_winamp, WM_USER, Index, 211));
Result := String(PC);
end;
With PC returning the filename string, but this causes an Access Violation, (incidently, I've checked to see if PC is nil (same as NULL in C), it isn't). I also know hwnd_winamp is pointing to the correct window handle, as the other commands work ok.
A description of the command reads as follows:
211 - Retrieves (and returns a pointer in 'ret') a string that contains the filename of a playlist entry (indexed by 'data'). Returns NULL if error, or if 'data' is out of range.
Anyone help? Or has anyone got a working example of using call in another language, such as C++? Maybe I could port it over.
Thanks
I've been communicationg with Winamp 2.7 using the Winamp api and Delphi. Everything has worked ok, apart from one call, 211, getting the filename of a track in the playlist.
My code looks like this:
var
PC : PChar;
Index : Integer;
begin
Index := 0;
PC := PChar(SendMessage(hwnd_winamp, WM_USER, Index, 211));
Result := String(PC);
end;
With PC returning the filename string, but this causes an Access Violation, (incidently, I've checked to see if PC is nil (same as NULL in C), it isn't). I also know hwnd_winamp is pointing to the correct window handle, as the other commands work ok.
A description of the command reads as follows:
211 - Retrieves (and returns a pointer in 'ret') a string that contains the filename of a playlist entry (indexed by 'data'). Returns NULL if error, or if 'data' is out of range.
Anyone help? Or has anyone got a working example of using call in another language, such as C++? Maybe I could port it over.
Thanks