var
  info:array[0..200] of char;
  ...
begin
  
  DLLPath:=ExtractFiledir(Application.exeName);
  DLLPath:=DLLPath+'\termb.dll';
  DLLHandle:=LoadLibrary(Pchar(DLLPath));
  @mInitComm:=GetProcAddress(DLLHandle,'CVR_InitComm');
  @mCloseComm:=GetProcAddress(DLLHandle,'CloseComm');
  @mAuthenticate:=GetProcAddress(DLLHandle,'CVR_Authenticate');
  @mRead_Content:=GetProcAddress(DLLHandle,'CVR_Read_Content');
  @GetName:=GetProcAddress(DLLHandle,'GetPeopleName');  mInitComm(1001);
  mAuthenticate;
  mRead_Content(1);
  fillchar(info,200,#0);
  GetName(@info[1],200);    //内存错误,请指正

解决方案 »

  1.   

    procedure TReadCard_F.Timer1Timer(Sender: TObject);
    var
      pucCHMsg,puiPHMsgLen:PChar;
      ss,strTemp,s,dates,months,days,yys,sa,sx,path,limit1,limit2,x1,y1,z1,j1,x2,y2,z2,f2,strall,hmd:string;
      i,n:Integer;
      mzdmini:TIniFile;
      t:Tstringlist;
      Tdate:TDateTime;
    begin
      inherited;
      if isReadingCard then
        Exit;
      path:=ExtractFilePath(ParamStr(0));
      puiPHMsgLen:='pictures.bmp';
      pucCHMsg:=ReadIDCardBig5(iPort,puiPHMsgLen);
      ss:=pucCHMsg;
      n:=0;
      i:=Pos('<!--',ss);
      if i>0 then
      begin
        Image3.Visible:=True;
        isReadingCard:=True;
        cxImage1.Picture.LoadFromFile(puiPHMsgLen);
      end;
      while i>0 do
      begin
        Application.ProcessMessages;
        strTemp:=Copy(ss,i+4,Pos('--!>',ss)-5);
        //ShowMessage(strTemp);
        Image3.Visible:=True;
        case n of
          0:
          begin
            Edit6.Text:=strTemp;
          end;
          1:
          begin
            Edit1.Text:=strTemp;
            if (Edit6.Text<>'')or(Edit1.Text<>'') then
            begin
              Image3.Visible:=True;
              strall:=(gg.Search('sAll',1,Edit6.Text,ChinaToUnicode(Edit1.Text), _UserNo,ChinaToUnicode(_UserName)));
              t:=TStringList.Create;
              try
                Image3.Visible:=True;
                t.Delimiter:=',';
                t.DelimitedText:=strall;
                if(Trim(Edit6.Text)=Trim(t.Strings[0])) and (t.Strings[1]='一致') and (t.Strings[2]='一致') then
                begin
                  RzLabel2.Caption:='一致';
                  RzLabel3.Caption:='合格';
                  RzLabel2.Font.Color:=clGreen;
                  RzLabel3.Font.Color:=clGreen;
                  //取圖片
                  if (t.Strings[4]='1') then
                  begin
                    Image3.Visible:=True;
                    DownLoadFile('http://172.20.100.10/CardID/photo/'+Edit6.Text+'.jpg','C:\a.jpg');
                    cxImage2.Picture.LoadFromFile('C:\a.jpg');
                    DeleteFile('C:\a.jpg');
      

  2.   

    http://www.id-sys.cn/project/bangzhu/784.html你看看人家文档中怎么用Delphi调的