Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save menjaraz/af7532d2852a829070856fd9eddad286 to your computer and use it in GitHub Desktop.
Save menjaraz/af7532d2852a829070856fd9eddad286 to your computer and use it in GitHub Desktop.
DelphiにおけるStringをPAnsiCharへ安全に変換する
function ConvertStringToPAnsiChar(str:string):PAnsiChar;
var
p:PAnsiChar;
begin
GetMem(p, Length(string) + 1);
System.AnsiStrings.StrPCopy(p, str);
Result := p;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment