var
  Form1: TForm1;
implementation
   function InitTaxSet(): integer;stdcall; external 'TaxLib.dll';
   Function Get_ErrorMsg(ErrNo: integer; pErrMsg: PChar): integer;stdcall; external 'TaxLib.dll';
   Function GetCurrInvNo ( PCurrInvNo: PChar; PStartNo: PChar;PEndNo: PChar; PCount: PChar): integer; stdcall; external 'TaxLib.dll';
   function Get_InvCode(PInvNo: Pchar; PInvCode: PChar): integer; external 'TaxLib.dll';
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);var
   k:integer;
   pErrMsg: PChar;
begin
   k:=InitTaxSet();
   if (k<>0) then
   begin
     if (Get_ErrorMsg(k,pErrMsg)=0) then
     begin
         ShowMessage('检测设备失败:::'+pErrMsg);
     end
     else
          ShowMessage('检测设备失败!错误无法识别');
   end
   else
   ShowMessage('检测设备成功!');
end;procedure TForm1.Button2Click(Sender: TObject);
var
PCurrInvNo: PChar;
PStartNo: PChar;
PEndNo: PChar;
PCount: PChar;
K:integer;
begin
    k:=GetCurrInvNo (PCurrInvNo,PStartNo,PEndNo,PCount);
    if (k=0) then
    begin
        ShowMessage('函数调用成功');
    end
    else if (k<>0) then
    begin
       if (k=225)then
       begin
          ShowMessage('需要换卷');
       end;
       ShowMessage('函数调用失败');
    end
end;
当点击第二个按钮时就报错误“Project PMax.exe raised exception class EAccessViolation with message 'Access violation at
address 00479705 in module 'TaxLib.dll'.Write of address 0042c694 Process stopped. Use step
or Run to continue.”
请问高手是怎么回事!谢谢!