Delphi 装上  pdf.ocx后,将控件放在窗体上程序却不能运行,是什么原因?

解决方案 »

  1.   

    错误信息如下:
    ---------------------------
    Debugger Exception Notification
    ---------------------------
    Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 10006E10 in module 'pdf.ocx'. Read of address 0000001C'. Process stopped. Use Step or Run to continue.
    ---------------------------
    OK   Help   
    ---------------------------
      

  2.   

    应该怎么做呢?我只是放上一个pdf的控件,没写代码呀
      

  3.   

        try
        FPdf := TPdf.Create(self);
        FPdf.Parent:=self;
        FPdf.Align:=alClient;
        FPdf.src:='D:\Test\GDCA_Test.pdf';
        except
        showmessage('error');
        end;
    它必须是动态创建的,否则窗体还没打开就出错!
    在窗体关闭的时候最好把fpdf.free;把资源释放掉,否则也会出现该错误!