I tested @Luckies code and it working in example, but don't work in this case:
Delphi-Quellcode:
function func1(s: PChar; Buffer: PChar; lenBuffer: Integer): Integer; external 'StringDLL.dll';
var
Buffer: array [0..MAX_PATH] of Char;
BufferSize: DWORD;
begin
BufferSize := High(Buffer);
func1('bar', Buffer, BufferSize);
ShowMessage(Buffer);
end;
Raises
AV. Windows functions working, this one not. Why?