Hi Adam,
despite tearing out some hair and losing a
Hopefully you have spare :)
Result := PAnsiChar(NotesList.Strings[0]);
NotesList.Delete(0);
The problem is that you give a pointer to the return value of that function
to something that not exists anymore after the functions exit:
Hi, Wilfried - thanks for the explanation - I've been looking at the code
for hours and just couldn't see the cause. I've now changed the code to
this which should solve the problem if I understood correctly:
function ReadMessage: PAnsiChar; stdcall;
var
Note: AnsiString;
begin