IVsRunningDocumentTable.RegisterDocumentLockHolder Method

Registers a document lock holder in the running document table.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function RegisterDocumentLockHolder ( _
    grfRDLH As UInteger, _
    dwCookie As UInteger, _
    pLockHolder As IVsDocumentLockHolder, _
    <OutAttribute> ByRef pdwLHCookie As UInteger _
) As Integer
int RegisterDocumentLockHolder(
    uint grfRDLH,
    uint dwCookie,
    IVsDocumentLockHolder pLockHolder,
    out uint pdwLHCookie
)
int RegisterDocumentLockHolder(
    [InAttribute] unsigned int grfRDLH, 
    [InAttribute] unsigned int dwCookie, 
    [InAttribute] IVsDocumentLockHolder^ pLockHolder, 
    [OutAttribute] unsigned int% pdwLHCookie
)
abstract RegisterDocumentLockHolder : 
        grfRDLH:uint32 * 
        dwCookie:uint32 * 
        pLockHolder:IVsDocumentLockHolder * 
        pdwLHCookie:uint32 byref -> int
function RegisterDocumentLockHolder(
    grfRDLH : uint, 
    dwCookie : uint, 
    pLockHolder : IVsDocumentLockHolder, 
    pdwLHCookie : uint
) : int

Parameters

  • dwCookie
    Type: System.UInt32

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

  • pdwLHCookie
    Type: System.UInt32%

    [out] Unique value representing the document lock holder.

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::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.

.NET Framework Security

See Also

Reference

IVsRunningDocumentTable Interface

Microsoft.VisualStudio.Shell.Interop Namespace