IVsRunningDocumentTable.UnlockDocument(UInt32, UInt32) Method

Definition

Releases a read or edit lock on the open document.

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

Parameters

grfRDTLockType
UInt32

[in] Values are taken from the _VSRDTFLAGS enumeration. Use the RDT_RequestUnlock flag with this method to indicate what should happen if this is the last unlock, because the last unlock will cause the document to be saved.

dwCookie
UInt32

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

Returns

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

Remarks

COM Signature

From vsshell.idl:

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

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

If it is inconvenient to remember the dwCookie, then remember the pszMkDocument and call the FindAndLockDocument method to retrieve the dwCookie, and then call the UnlockDocument method twice. However, there are performance implications in doing this.

Applies to