Share via


HardTotals.ClaimFile Method

2/27/2008

Tries to gain exclusive access to a specific file for use.

Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)

Syntax

'Declaration
Public MustOverride Sub ClaimFile ( _
    handle As Integer, _
    timeout As Integer _
)
public abstract void ClaimFile (
    int handle,
    int timeout
)
public:
virtual void ClaimFile (
    int handle, 
    int timeout
) abstract
public abstract void ClaimFile (
    int handle, 
    int timeout
)
public abstract function ClaimFile (
    handle : int, 
    timeout : int
)

Parameters

  • handle
    Handle to the totals file to claim.
  • timeout
    The time (in milliseconds) to wait for the file to become available.If zero, ClaimFile tries to claim the file, then returns the appropriate status immediately.If WaitForever is specified, ClaimFile waits as long as needed until exclusive access is satisfied.

Remarks

Tries to gain exclusive access to a specific file for use by the claiming application. When it is granted, the application maintains exclusive access until it explicitly releases access or until the device is closed.

If any other applications have claimed exclusive access to this file by using ClaimFile, or if any other application has claimed exclusive access to the whole totals area by using Claim then this ClaimFile cannot be satisfied until those claims have been released.

All claims are released when the application calls the Close method.

ClaimFile may cause a PosControlException to be thrown with one of the following ErrorCodes.

Value

Meaning

Illegal

The handle is invalid, or an invalid timeout parameter was specified.

Timeout

The timeout value expired before another application released exclusive access of either the requested totals file or the whole totals area.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread-safe. Any instance members are not guaranteed to be thread-safe.

See Also

Reference

HardTotals Class
HardTotals Members
Microsoft.PointOfService Namespace
ReleaseFile