RunningDocumentTable.FindDocument Method

Definition

Gets information about a specific document from the Running Document Table (RDT).

Overloads

FindDocument(String)

Gets an object from the Running Document Table (RDT) that represents the document specified by the given path.

FindDocument(String, UInt32)

Gets a cookie from the Running Document Table (RDT) that represents the document specified by the given path.

FindDocument(String, IVsHierarchy, UInt32, UInt32)

Gets an object, cookie, and owning project type from the Running Document Table (RDT) for the document specified by the given path.

Remarks

Given the path to the document file, the RDT can obtain information about that document such as the owning project or the cookie associated with the document. The RDT uses unique values called cookies to track each individual document.

FindDocument(String)

Gets an object from the Running Document Table (RDT) that represents the document specified by the given path.

public:
 Platform::Object ^ FindDocument(Platform::String ^ moniker);

Parameters

moniker
String

[in] Path to the desired document.

Returns

An object that can be cast to an appropriate interface to access the document (see Remarks for details), or null if the document is not registered with Visual Studio.

Remarks

The object returned can typically be cast to the IVsPersistDocData interface or the IVsDocDataFileChangeControl interface.

Applies to

FindDocument(String, UInt32)

Gets a cookie from the Running Document Table (RDT) that represents the document specified by the given path.

public:
 System::Object ^ FindDocument(System::String ^ moniker, [Runtime::InteropServices::Out] System::UInt32 % docCookie);

Parameters

moniker
String

[in] Path to the desired document.

docCookie
UInt32

[out] Returns the unique value that represents the requested document in the RDT.

Returns

An object that can be cast to an appropriate interface to access the document (see Remarks for details), or null if the document is not registered with Visual Studio.

Remarks

The cookie can be used in a call to the GetRunningDocumentContents method.

The object returned can typically be cast to the IVsPersistDocData interface or the IVsDocDataFileChangeControl interface.

Applies to

FindDocument(String, IVsHierarchy, UInt32, UInt32)

Gets an object, cookie, and owning project type from the Running Document Table (RDT) for the document specified by the given path.

public:
 System::Object ^ FindDocument(System::String ^ moniker, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ % hierarchy, [Runtime::InteropServices::Out] System::UInt32 % itemid, [Runtime::InteropServices::Out] System::UInt32 % docCookie);

Parameters

moniker
String

[in] Path to the desired document.

hierarchy
IVsHierarchy

[out] Returns an IVsHierarchy object that represents the project that owns the requested document.

itemid
UInt32

[out] Returns the ID of the document in the IVsHierarchy object.

docCookie
UInt32

[out] Returns the unique value that represents the requested document in the RDT.

Returns

An object that can be cast to an appropriate interface to access the document (see Remarks for details). If a null value is returned, the document is not registered with Visual Studio.

Remarks

The cookie can be used in a call to the GetRunningDocumentContents method.

The object returned can typically be cast to the IVsPersistDocData interface or the IVsDocDataFileChangeControl interface.

Applies to