IVsUIShellOpenDocument::OpenDocumentViaProjectWithSpecific Method (String^, UInt32, Guid, String^, Guid, IServiceProvider^, IVsUIHierarchy^, UInt32, IVsWindowFrame^)
Finds a specified project to open this document.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int OpenDocumentViaProjectWithSpecific( String^ pszMkDocument, unsigned int grfEditorFlags, [InAttribute] Guid% rguidEditorType, String^ pszPhysicalView, [InAttribute] Guid% rguidLogicalView, [OutAttribute] IServiceProvider^% ppSP, [OutAttribute] IVsUIHierarchy^% ppHier, [OutAttribute] unsigned int% pitemid, [OutAttribute] IVsWindowFrame^% ppWindowFrame )
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.
- grfEditorFlags
-
Type:
System::UInt32
[in] Flags whose values are taken from the __VSSPECIFICEDITORFLAGS enumeration.
- rguidEditorType
-
Type:
System::Guid
[in] Unique identifier of the editor type.
- pszPhysicalView
-
Type:
System::String^
[in] Unique identifier of the physical view.
- rguidLogicalView
-
Type:
System::Guid
[in] Unique identifier of the logical view. If the editor implements IVsMultiViewDocumentView on the document view object, then the value passed into the rguidLogicalView parameter determines which view is activated when the editor window is shown, when the editor is instantiated. By specifying the logical view GUID, you can request the specific view that matches the reason you are requesting the view. For example, specify LOGVIEWID_Debugging to get the view appropriate for debugging, or LOGVIEWID_TextView to get the view appropriate for the text editor (that is, a view that implements IVsCodeWindow).
- ppSP
-
Type:
Microsoft.VisualStudio.OLE.Interop::IServiceProvider^
[out] Pointer to the IServiceProvider interface.
- ppHier
-
Type:
Microsoft.VisualStudio.Shell.Interop::IVsUIHierarchy^
[out] Pointer to the IVsUIHierarchy interface of the project that can open the document.
- pitemid
-
Type:
System::UInt32
[out] Pointer to the hierarchy item identifier of the document in the project. For more information see VSITEMID.
- ppWindowFrame
-
Type:
Microsoft.VisualStudio.Shell.Interop::IVsWindowFrame^
[out, retval] Pointer to the window frame that contains the editor. For more information, see IVsWindowFrame.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From vsshell.idl:
HRESULT IVsUIShellOpenDocument::OpenDocumentViaProjectWithSpecific( [in] LPCOLESTR pszMkDocument, [in] VSSPECIFICEDITORFLAGS grfEditorFlags, [in] REFGUID rguidEditorType, [in] LPCOLESTR pszPhysicalView, [in] REFGUID rguidLogicalView, [out] IServiceProvider **ppSP, [out] IVsUIHierarchy **ppHier, [out] VSITEMID *pitemid, [out, retval] IVsWindowFrame **ppWindowFrame );
This method is used by VSPackages that are not projects that need to open a document in a specific editor, but do not care which project opens the file. To call this method from your VSPackage, you need to know exactly which editor factory you want and exactly which window you want the editor factory to create (that is, the physical view). The logical view specified in the rguidLogicalView parameter further allows you to specify which tab should be displayed by the editor if the editor implements IVsMultiViewDocumentView.
This method calls OpenItem. If no project can service the file and the Miscellaneous Files project is not already present, the environment then creates the Miscellaneous Files project and tries again.