constructor TDataThread.Create(StrThread: string);
begin
  CurPath := ExtractFilePath(ParamStr(0));
  ThreadIni := TIniFile.Create(CurPath+'Configuration\ThreadWebs.ini');
  ScriptIni := TIniFile.Create(curpath+'Configuration\script.ini');
  GetAllParams(StrThread) ;
  //**************************************  //**************************************
  inherited Create(false) ;
end;destructor TDataThread.Destroy;
begin
  ThreadIni.Free ;
  ScriptIni.Free ;
  inherited;
end;procedure TDataThread.Execute;
begin
  OnTerminate := FrmMain.ThreadsDone;
{GetContent是我写的DLL的一个导出函数}
  GetContent(aurl, aaccordantText,aaccordantimage, aCurTable_list , aCurCol_list,aCurTable_page ,aCurTableRow, aCurTableCell, abeginText , aEndText ,aThreadnum ,aInsertTable , aatype,aSavePath) ;
end;

解决方案 »

  1.   

    可能你写的GetContent函数不是线程安全的。
      

  2.   

    用LoadLibray还是不行,程序总是到了调用DLL函数GetContent时过不去,说
    没有调用CoInitialize() ,我在Execute函数中加上了CoInitialize(nil) ;
    程序倒是可以执行了,可是GetContent中的操作却不运行了,我快疯了
      

  3.   

    在你的线程create的时候LoadLibrary(),函数指针声明为private变量再试试
      

  4.   

    在你的Dll程序开头加上IsMultiThread := True;