Thema: Delphi How to - string in DLL

Einzelnen Beitrag anzeigen

Benutzerbild von jaenicke
jaenicke

Registriert seit: 10. Jun 2003
Ort: Berlin
9.370 Beiträge
 
Delphi 11 Alexandria
 
#10

AW: Re: How to - string in DLL

  Alt 19. Jun 2011, 19:45
Delphi-Quellcode:
  foo := 'foo'+ s;
  if Assigned(Buffer) then
    StrLCopy(Buffer, PWideChar(foo), lenBuffer);
You try to copy lenBuffer Bytes from foo, but it does not have so many Bytes.

By the way: I prefer the way most of the API functions work:
First I ask for the buffer size needed, then I reserve enough memory and ask for the data itself.
Sebastian Jänicke
Alle eigenen Projekte sind eingestellt, ebenso meine Homepage, Downloadlinks usw. im Forum bleiben aktiv!
  Mit Zitat antworten Zitat