Forum: Object-Pascal / Delphi-Language
Delphi
by jaenicke,
22. Jun 2011
I think this is a problem with the size parameter.
You always have to have in mind that one character is one byte in Delphi 7 and two bytes in Delphi 2010.
How does the code for reserving the memory, ... look like?
Forum: Object-Pascal / Delphi-Language
Delphi
by jaenicke,
19. Jun 2011
What about this:function Foonction(Data: PWideChar; Buffer: PWideChar; lenBuffer: Cardinal): Cardinal; external 'StringDLL.dll';
var
Buffer: string;
BufferSize: DWORD;
begin
BufferSize := Foonction('bar', nil, 0);
if BufferSize > 0 then
begin
SetLength(Buffer, BufferSize);