|
UnLock
|
|
|
The UnLock method unlocks data region in file.
C++
long UnLock(
long LockHandle // handle of locked region
);
BASIC
UnLock(
LockHandle As Long // handle of locked region
) As Long
Parameters
- LockHandle
- Handle of a locked region returned from call to one of the Lock methods.
If this parameter is -1 all locks created by the object are released.
Return Values
If the method succeeds, the return value is 0.
If the method fails, the return value is failure code and error code is set.
Call GetError to get error code.
Remarks
When multiple locking is used (see Locking File for description of multiple locking), file region identified by LockHandle
can remain physically locked when method completes, because other dependent locks can be still active.
Map of the locks is maintained internally by the object to guarantee correct order of unlocking - file region is physically unlocked only when
there are no dependent locks active. In any case LockHandle is no longer valid when method completes. All locks created by the object
can be released at once by setting LockHandle to -1.
See Also
LockByte,
LockShort,
LockLong,
LockFloat,
LockDouble,
LockText,
LockUnicodeText,
LockVariant,
LockBinary,
Locking File