IVsRunningDocumentTable.RegisterDocumentLockHolder Method (UInt32, UInt32, IVsDocumentLockHolder, UInt32)
Registers a document lock holder in the running document table.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int RegisterDocumentLockHolder( uint grfRDLH, uint dwCookie, IVsDocumentLockHolder pLockHolder, out uint pdwLHCookie )
Parameters
- grfRDLH
-
Type:
System.UInt32
[in] This is zero or a flag taken from the __VSREGDOCLOCKHOLDER enumeration.
- dwCookie
-
Type:
System.UInt32
[in] Abstract value representing the open document for which the read or edit lock is to be released.
- pLockHolder
-
Type:
Microsoft.VisualStudio.Shell.Interop.IVsDocumentLockHolder
[in] An IVsDocumentLockHolder interface representing the document lock holder for the registered document.
- pdwLHCookie
-
Type:
System.UInt32
[out] Unique value representing the document lock holder.
Return Value
Type: System.Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From vsshell.idl:
HRESULT IVsRunningDocumentTable::RegisterDocumentLockHolder( [in] VSREGDOCLOCKHOLDER grfRDLH, [in] VSCOOKIE dwCookie, [in] IVsDocumentLockHolder *pLockHolder, [out] VSCOOKIE *pdwLHCookie );
Use this identifier returned in the pdwLHCookie parameter to unregister the document lock holder by calling the UnregisterDocumentLockHolder method.
The dwCookie parameter is same value that is returned from the FindAndLockDocument or RegisterAndLockDocument methods.