This documentation is archived and is not being maintained.

IVsProject.IsDocumentInProject Method

Determines whether a document is in the project.

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

abstract IsDocumentInProject : 
        pszMkDocument:string * 
        pfFound:int byref * 
        pdwPriority:VSDOCUMENTPRIORITY[] byref * 
        pitemid:uint32 byref -> int

Parameters

pszMkDocument
Type: String

[in] Pointer to the document moniker for which to search.

pfFound
Type: Int32

[out] Pointer to a BOOL. Implementer sets contents to true if the document is found in the project, false if otherwise or an error occurs.

pdwPriority
Type: Microsoft.VisualStudio.Shell.Interop.VSDOCUMENTPRIORITY[]

[out] Priority level whose value is taken from the VSDOCUMENTPRIORITY enumeration if the document is found; zero if not or an error occurs.

pitemid
Type: UInt32

[out] Pointer to the item identifier of the document within the project. Should be VSITEMID_ROOT or other valid item identifier. See the enumeration VSITEMID. If the document is found, implementer sets contents to a value; if not found or an error occurs, implementer sets contents to zero.

Return Value

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

To see some code that uses this property, see Walkthrough: Managing Universal Windows Projects.

COM Signature

From vsshell.idl:

HRESULT IVsProject::IsDocumentInProject(
   [in] LPCOLESTR pszMkDocument,
   [out] BOOL *pfFound,
   [out] VSDOCUMENTPRIORITY *pdwPriority,
   [out] VSITEMID *pitemid);

If any parameter is a null reference (Nothing in Visual Basic), set any non-null parameter to its error setting, and return E_INVALIDARG.

Show: