Adam Burgoyne wrote:
> 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
> EnterCriticalSection(CritSectn);
>
> if (NotesList.Count > 0) then
> begin
>Note := NotesL
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
EnterCriticalS
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, All
Ok - first the good news... despite tearing out some hair and losing a good
few hours of sleep, my new TWSocket-based DLL with the worker thread is
working brilliantly :-)
Now for the bad news... I am getting some strange and intermittent
"corruption" of function return values.
I'm not s