DLL:
procedure GetStr: PChar; stdcall;
begin
Result := PChar('True');
end;调用DLL的主程序:
function GetStr: PChar; stdcall; external 'Common.dll';procedure TFrmMain.Button1Click(Sender: TObject);
begin
Button1.Caption := GetStr; //这里会返回True
end;
为什么True后面会多个, 用UE查看ASCII是#14, why?
procedure GetStr: PChar; stdcall;
begin
Result := PChar('True');
end;调用DLL的主程序:
function GetStr: PChar; stdcall; external 'Common.dll';procedure TFrmMain.Button1Click(Sender: TObject);
begin
Button1.Caption := GetStr; //这里会返回True
end;
为什么True后面会多个, 用UE查看ASCII是#14, why?
ZeroMemory(result, Length(Decode_Str)+1);
StrPCopy(Result, Decode_Str);