dllHandle := LoadLibrary('project1.dll');try......finallyFreeLibrary(dllHandle); end;这样写肯定是没有错的,错的是你里面的代码 ,例如:调用DLL部分procedure TMainForm.StartClick(Sender: TObject);var ProcAddr: FarProc; ProvaChild: T_ProvaChild;begin DllHandle := LoadLibrary('ProjectDll'); try if DllHandle=0 then raise Exception.Create('未发现ProjectDll.dll加载失败!!') else begin ProcAddr := GetProcAddress(DllHandle, 'ProvaChild'); if ProcAddr <> nil then begin ProvaChild := ProcAddr; ProvaChild(Application,Self); end; end; finally //FreeLibrary(DllHandle); 如果不注释掉也会报错的 end;end;DLL部分 function ProvaChild(ParentApplication: TApplication; ParentForm: TForm):LongInt; export; stdcall;begin Application:=ParentApplication; if not Assigned(Form1) then begin Form1:=TForm1.Create(ParentForm); Form1.MyParentForm:=ParentForm; Form1.MyParentApplication:=ParentApplication; Windows.SetParent(Form1.Handle,ParentForm.Handle); Form1.FormStyle:=fsMDIChild; Result:=LongInt(Form1) ; Form1.Show; end else Form1.BringToFront;end;我调用dLL中 ProvaChild 函数创建 MDI窗体 , 刚SHOW出来 就释放 dllHandle肯定报错了!