我现在正在做医保的接口,其中有一个dll重的函数定义如下:
//功能:查询持卡患者的个人信息(不需要密码)
//出口参数:字符串,所指向的存储区必须大于 240 字节
//返回值:1:未找到该人员;3:IC卡不可用(挂失或损毁);4:客户端版本需要更新;5:本医院不是该人员的定点医院
PROXY_API f_comm_getpersoninfo_nopasswd(char* szOut);
我用delphi调用它,代码如下:
procedure TForm1.BitBtn1Click(Sender: TObject);
type
  TIntFunc=function():string;stdcall;
var
  Th:Thandle;
  Tf:TIntFunc;
  Tp:TFarProc;
begin
  Th:=LoadLibrary('ProxyDll.dll'); {装载DLL}
  if Th>0 then
  try
    Tp:=GetProcAddress(Th,PChar('f_comm_getpersoninfo_nopasswd');
    if Tp<>nil then
    begin
      Tf:=TIntFunc(Tp);
      Edit1.Text:=Tf(); {调用'f_comm_getpersoninfo_nopasswd函数}
    end
    else
      ShowMessage('f_comm_getpersoninfo_nopasswd函数没有找到');
    finally
      FreeLibrary(Th); {释放DLL}
    end
  else
    ShowMessage('ProxyDll.dll没有找到');
end;
可是老是在 Edit1.Text:=Tf(); {调用'f_comm_getpersoninfo_nopasswd函数} 处报错 读零地址。麻烦大家帮我看看,这段代码的错误到底出现在哪里。