Sdílet prostřednictvím


IVsRunningDocumentTable.FindAndLockDocument Method

Definition

Locates a document in the RDT using the document file name, then obtains a read or edit lock on that document.

public:
 int FindAndLockDocument(System::UInt32 dwRDTLockType, System::String ^ pszMkDocument, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ % ppHier, [Runtime::InteropServices::Out] System::UInt32 % pitemid, [Runtime::InteropServices::Out] IntPtr % ppunkDocData, [Runtime::InteropServices::Out] System::UInt32 % pdwCookie);
public int FindAndLockDocument (uint dwRDTLockType, string pszMkDocument, out Microsoft.VisualStudio.Shell.Interop.IVsHierarchy ppHier, out uint pitemid, out IntPtr ppunkDocData, out uint pdwCookie);
abstract member FindAndLockDocument : uint32 * string * IVsHierarchy * uint32 * nativeint * uint32 -> int
Public Function FindAndLockDocument (dwRDTLockType As UInteger, pszMkDocument As String, ByRef ppHier As IVsHierarchy, ByRef pitemid As UInteger, ByRef ppunkDocData As IntPtr, ByRef pdwCookie As UInteger) As Integer

Parameters

dwRDTLockType
UInt32

[in] Flags whose values are taken from the _VSRDTFLAGS enumeration.

pszMkDocument
String

[in] Path to the located document.

ppHier
IVsHierarchy

[out, optional] Returns the IVsHierarchy interface for the located document.

pitemid
UInt32

[out, optional] Returns an item identifier of the located document. This is a unique identifier or it can be one of the following values: VSITEMID_NIL, VSITEMID_ROOT, or VSITEMID_SELECTION.

ppunkDocData
IntPtr

nativeint

[out, optional] Returns the IUnknown interface. See Remarks for details.

pdwCookie
UInt32

[out, optional] Returns an abstract value for the document.

Returns

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

Remarks

This method must be accessed on the main thread.

Applies to