Delphi DLL 字符串传递例子
library EN;
uses
SysUtils,
Classes,
UnitFormEN in 'UnitFormEN.pas' {FormEN};
{$R *.res}
function GetJobType(p: PChar): Boolean; stdcall;
var
str: string;
begin
str := '我们是中国人,我们爱自己的祖国.';
StrCopy(p, PChar(str));
Result := Length(p) > Length(str);
end;
function GetRates(p: PChar): Boolean; stdcall;
var
str: string;
begin
str := '我爱北京天安门.';
StrCopy(p, PChar(str));
Result := Length(p) > Length(str);
end;
exports
GetJobType,
GetRates,
ShowFormEN;
begin
end.