Compartilhar via


IVsRunningDocumentTable.LockDocument(UInt32, UInt32) Method

Definition

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

public:
 int LockDocument(System::UInt32 grfRDTLockType, System::UInt32 dwCookie);
public:
 int LockDocument(unsigned int grfRDTLockType, unsigned int dwCookie);
int LockDocument(unsigned int grfRDTLockType, unsigned int dwCookie);
public int LockDocument (uint grfRDTLockType, uint dwCookie);
abstract member LockDocument : uint32 * uint32 -> int
Public Function LockDocument (grfRDTLockType As UInteger, dwCookie As UInteger) As Integer

Parameters

grfRDTLockType
UInt32

[in] Flag whose value is taken from the _VSRDTFLAGS enumeration.

dwCookie
UInt32

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

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

This method must be accessed on the main thread.

Applies to