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
'Dichiarazione
Function LockDocument ( _
grfRDTLockType As UInteger, _
dwCookie As UInteger _
) As Integer
'Utilizzo
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
grfRDTLockType
Type: System.UInt32[in] Flag whose value is taken from the _VSRDTFLAGS enumeration.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
IVsRunningDocumentTable Interface