Share via


IVsRunningDocumentTable.LockDocument Method

Obtains a read or edit lock on a document when it is opened.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function LockDocument ( _
    grfRDTLockType As UInteger, _
    dwCookie As UInteger _
) As Integer
int LockDocument(
    uint grfRDTLockType,
    uint dwCookie
)
int LockDocument(
    [InAttribute] unsigned int grfRDTLockType, 
    [InAttribute] unsigned int dwCookie
)
abstract LockDocument : 
        grfRDTLockType:uint32 * 
        dwCookie:uint32 -> int
function LockDocument(
    grfRDTLockType : uint, 
    dwCookie : uint
) : int

Parameters

  • dwCookie
    Type: System.UInt32

    [in] Abstract value representing the open document for which a read or an edit lock is to be obtained.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsRunningDocumentTable::LockDocument(
   [in] VSRDTFLAGS grfRDTLockType,
   [in] VSCOOKIE   dwCookie
);

The dwCookie parameter is the same value that is returned from the FindAndLockDocument or RegisterAndLockDocument methods.

.NET Framework Security

See Also

Reference

IVsRunningDocumentTable Interface

Microsoft.VisualStudio.Shell.Interop Namespace