Topic: How to define, what file DLL is occupied?
At an application launch I define checksum of file DLL then the first application starts to use DLL.
At start of the second copy of the program the second copy starts to define checksum of this DLL. Error I/O error 32 jumps out.
Tried to check file employment, but at AssignFile (AFile, AFileName); in the second copy this error jumps out.
procedure TDM1.ActDLLExistsExecute (Sender: TObject);//Stock-taking DLL from the list function isFileOpen (var f: File): boolean; begin with TFileRec (f) do Result: = (Handle <> 0) and (Mode <> fmClosed); end; var fn: string; Ffs: File; begin QDLLFiles. Open; while not QDLLFiles. Eof do begin fn:=DM1.QDLLFilesGoal.AsString+DM1.QDLLFilesName.AsString; if not FileExists (fn) then begin DM1.QDLLFilesBODY.SaveToFile (fn); end else begin [b] AssignFile (Ffs, fn); [/b]//Here in the second copy error I/O error 32 Reset (Ffs); if isFileOpen (Ffs) then//If this line is not present, an error in GetFileCRC (fn) as there too is AssignFile if GetFileCRC (fn) <> DM1.QDLLFilesCRC.Value then begin DM1.QDLLFilesBODY.SaveToFile (fn); end; CloseFile (Ffs); end; QDLLFiles. Next; end; QDLLFiles. Close; end;