IVsUIShellOpenDocument::IsDocumentInAProject Method (String^, IVsUIHierarchy^, UInt32, IServiceProvider^, Int32)

 

Determines whether a document is part of the project.

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

int IsDocumentInAProject(
	String^ pszMkDocument,
	[OutAttribute] IVsUIHierarchy^% ppUIH,
	[OutAttribute] unsigned int% pitemid,
	[OutAttribute] IServiceProvider^% ppSP,
	[OutAttribute] int% pDocInProj
)

Parameters

pszMkDocument
Type: System::String^

[in] String form of the unique moniker identifier of the document in the project system, for example, the full path to the file. In non-file cases, this identifier is often in the form of a URL.

ppUIH
Type: Microsoft.VisualStudio.Shell.Interop::IVsUIHierarchy^

[out] If the document is open, this is a pointer to the IVsUIHierarchy interface implementation of the project that contains the document. If the document is not open, the value of this parameter is null. You can call Query Interface From IVsUIHierarchy to obtain a pointer to the IVsHierarchy interface of the project.

pitemid
Type: System::UInt32

[out] Pointer to the hierarchy item identifier of the document in the project system. For more information see VSITEMID.

ppSP
Type: Microsoft.VisualStudio.OLE.Interop::IServiceProvider^

[out] Pointer to the IServiceProvider interface for the project.

pDocInProj
Type: System::Int32

[out, retval] Flags that indicate whether a document is part of a project. For more information, see __VSDOCINPROJECT.

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 IVsUIShellOpenDocument::IsDocumentInAProject(
   [in] LPCOLESTR pszMkDocument,
   [out] IVsUIHierarchy **ppUIH,
   [out] VSITEMID *pitemid,
   [out] IServiceProvider **ppSP,
   [out, retval] VSDOCINPROJECT *pDocInProj
);
Return to top
Show: