IVsRunningDocumentTable::LockDocument Method (UInt32, UInt32)

 

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

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

int LockDocument(
	unsigned int grfRDTLockType,
	unsigned int dwCookie
)

Parameters

grfRDTLockType
Type: System::UInt32

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

dwCookie
Type: System::UInt32

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

Return Value

Type: System::Int32

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

From vsshell.idl:

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

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

Return to top
Show: