我用delphi写的代码:
function getcompinfo(var szout:pchar):integer;stdcall;external 'abc.dll'
procedure aaa();
var
str : pchar; i:integer;
begin
if getcompinfo(str) = 0 then
showmessage(str);
end;
跟踪得到的结果:str:Inaccessible value
看起来是内存不足,请帮忙看看如何解决。谢谢。
function getcompinfo(out szout: WideString): integer;stdcall;external 'abc.dll'
procedure aaa();
var
str: WideString;
begin
if getcompinfo(str) = 0 then
showmessage(str);
end;