我調用DLL時出現
project prjoyama.exe raised exception class EAccessViolation with message 'Access violation at address 00373570 in module 'PubFunction.Dll'.Read of address FFFFFFD4'.Prosess stopped.Use Step or Run to continume.
的錯誤再運行時,錯誤如下:
project prjoyama.exe raised exception class EInvalidPointer with message 'Invalid pointer opneration'.Process stopped.Use Step or Run to continume.請幫幫!

解决方案 »

  1.   

    非法访问错误, 估计是你dll 的声明有问题!!!
      

  2.   

    PubFunction.Dll中的某个函数出错,应该贴出代码来。
      

  3.   

    函數不打包成DLL是對的。源碼好下:{$R *.res}//導入圖片
    procedure LoadToImage(Image :TImage;strICO :String);stdcall;overload;
    var
      strDir,strFile : string;
    begin
      GetDir(0,strDir); { 0 = 當前驅動器}
      strFile := strDir+strICO;
      if FileExists(strFile) then
      begin
        Image.Picture.LoadFromFile(strFile);
      end else
      begin
        Application.MessageBox('系統找不到背景文件!',PChar('系統訊息'),MB_OK);
      end;
    end;exports//導入圖片
    LoadToImage(Image :TImage;strICO :String);begin
    end.編譯通過
      

  4.   

    uses
      sharemem;
    加上这个单元;
      

  5.   

    uses
      sharemem;
    加上这个单元;或者用參數用PChar:
    LoadToImage(Image :TImage;strICO :PChar);
      

  6.   

    主程序與 dll都要加入 uses shareMem;
    修改, 
    exports
    LoadToImage(Image :TImage;strICO :String);

    exports
    LoadToImage; // 就可!
      

  7.   

    procedure LoadToImage(Image :TImage;strICO :String);stdcall;overload;
    //不要用string类型!如果你的dll是给vc++等别的语言的话,最好用pchar,如果你要是给你自己的delphi程序用的话,用pchar或shortstring都行,也可加单元sharemem(放在第一位);不过要在你调用该dll的程序中也加入单元sharemem;
        to :楼主,这样的错误是很普通的错误!以后的写代码中一定要切记!好运 !
      

  8.   

    主程序 程序文件与dll都要加入 uses shareMem;
    而且主程序程序文件一开始就加一般不出错。
      

  9.   

    请确认你的ShareMem写在最前面。
      

  10.   

    在Dll的工程文件中将ShareMem单元加入在uses列表中。
      

  11.   

    注意:  将procedure LoadToImage(Image :TImage;strICO :String);stdcall;overload;
    改为:
       procedure LoadToImage(Image :TImage;strICO :PChar);stdcall;overload;
      

  12.   

    可能你傳值得類型不對阿,
    dll數據類型很重要
      

  13.   

    哎呀 dll 中要传字符串不要用STRING而要用PCHAR,这个问题可以上top 10了