Skip to content

Instantly share code, notes, and snippets.

@bonjin6770
Last active January 5, 2018 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bonjin6770/9628392ed7461361b1a6 to your computer and use it in GitHub Desktop.
Save bonjin6770/9628392ed7461361b1a6 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