Freigeben über


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
'Usage
Dim instance As IVsRunningDocumentTable
Dim grfRDTLockType As UInteger
Dim dwCookie As UInteger
Dim returnValue As Integer

returnValue = instance.LockDocument(grfRDTLockType, _
    dwCookie)
int LockDocument(
    uint grfRDTLockType,
    uint dwCookie
)
int LockDocument(
    [InAttribute] unsigned int grfRDTLockType, 
    [InAttribute] unsigned int dwCookie
)
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.

Permissions

See Also

Reference

IVsRunningDocumentTable Interface

IVsRunningDocumentTable Members

Microsoft.VisualStudio.Shell.Interop Namespace