我用一个定时器动态调用一个DLL每当调用一次只少占用的资源增加4K,DLL涵数的返回值为一个自定意类型.

解决方案 »

  1.   

    动态调用吧,大致代码如下,自己改一下
    var
    hinst:thandle;
    fpointer:tfarproc;
    myfunct:tintfunction;
    begin
      hinst:=loadlibrary('*.dll');
      if  hinst>0 then
      try
        fpointer:=getprocaddress(hinst,pchar(combobox1.Text));
        if  fpointer<>nil then
        begin
          myfunct:=tintfunction(fpointer);
          edit3.Text:=inttostr(myfunct(strtoint(edit1.Text)));
        end
        else
        showmessage('dll is use');
        finally
        freelibrary(hinst);
        end
        else
        showmessage('no dll');
    end;
      

  2.   

    我的程要时时的动态调用DLL,调用时间为80毫秒一次,直到程序退出.
      

  3.   

    窗体建立的时候加载Dll,窗体释放的时候释放。
    Timer定时调用Dll函数就可以了。
    确保函数调用每次分配的资源得到释放。
      

  4.   

    DELPHI 2007都没解决的问题: 万恶的 DLL-4K 内存泄漏(转贴) 
    http://community.csdn.net/Expert/topic/5452/5452414.xml?temp=.2265283