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
'Usage
Dim instance As IVsRunningDocumentTable 
Dim grfRDLH As UInteger 
Dim dwCookie As UInteger 
Dim pLockHolder As IVsDocumentLockHolder 
Dim pdwLHCookie As UInteger 
Dim returnValue As Integer 

returnValue = instance.RegisterDocumentLockHolder(grfRDLH, _
    dwCookie, pLockHolder, pdwLHCookie)
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
)
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

IVsRunningDocumentTable Members

Microsoft.VisualStudio.Shell.Interop Namespace