I was not really thinking of a "threadsafe FreeFile" function,
more a tread-safe "File Open " function witch is returning a filehandle
that I can use in other file-related functions like SEEK,GET,GET$ etc.
------
But that is perhaps as hard to implement.
The only way out I can see here is to implement FreeFile in a dll
as a function and use critical section to create and maintain "filenumbers"
Code:
In a DLL Global MyFreeFile As CRITICAL_SECTION Function GetFileHandle()as long Static MyFileHandle& EnterCriticalSection MyFreeFile Incr MyFileHandle& If MyFileHandle& > 2,000,000,000 then MyFileHandle& = 1 Function = MyFileHandle& LeaveCriticalSection MyFreeFile End Function -- Anywhere in your code FilNr& = GetFileHandle Open MyFile$ for binary ... as #FilNr& Get FilNr&,.... Close FilNr&
Fred
mailto:[email protected][email protected]</A>
http://www.oxenby.se
[This message has been edited by Fred Oxenby (edited January 30, 2001).]
Leave a comment: