With the app I'm writing, I want to offer single and multi user licenses. What I'm looking at doing is to have a special file that is in the same folder as my SQLite3 database and write a combination of computer name/user id to it. I wanted to use LockFileEx to place a lock of the starting byte of each session slot that contains the computername/userid. If I do that using LockFileEx and say, the program or even the computer crashes will Windows release the lock? MSDN says that locks are released when the file is closed normally, When checking for current valid users, I was thinking of scanning the session slots and trying the LockFileEx on them, and if it succeeds then that session slot is invalid and does not factor into the tally of current active users.
I did look at the PB LOCK/UNLOCK commands. If does say all locks have to be removed via UNLOCK before a file can be closed which could be problematic in that I'd have to keep track of things in each program instance. Probably can be done....
Thoughts?
Rick Kelly