IVsUIShellOpenDocument.OpenDocumentViaProject Method

Finds an appropriate project to open the document.

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

Syntax

‘선언
Function OpenDocumentViaProject ( _
    pszMkDocument As String, _
    ByRef rguidLogicalView As Guid, _
    <OutAttribute> ByRef ppSP As IServiceProvider, _
    <OutAttribute> ByRef ppHier As IVsUIHierarchy, _
    <OutAttribute> ByRef pitemid As UInteger, _
    <OutAttribute> ByRef ppWindowFrame As IVsWindowFrame _
) As Integer
‘사용 방법
Dim instance As IVsUIShellOpenDocument
Dim pszMkDocument As String
Dim rguidLogicalView As Guid
Dim ppSP As IServiceProvider
Dim ppHier As IVsUIHierarchy
Dim pitemid As UInteger
Dim ppWindowFrame As IVsWindowFrame
Dim returnValue As Integer

returnValue = instance.OpenDocumentViaProject(pszMkDocument, _
    rguidLogicalView, ppSP, ppHier, pitemid, _
    ppWindowFrame)
int OpenDocumentViaProject(
    string pszMkDocument,
    ref Guid rguidLogicalView,
    out IServiceProvider ppSP,
    out IVsUIHierarchy ppHier,
    out uint pitemid,
    out IVsWindowFrame ppWindowFrame
)
int OpenDocumentViaProject(
    [InAttribute] String^ pszMkDocument, 
    [InAttribute] Guid% rguidLogicalView, 
    [OutAttribute] IServiceProvider^% ppSP, 
    [OutAttribute] IVsUIHierarchy^% ppHier, 
    [OutAttribute] unsigned int% pitemid, 
    [OutAttribute] IVsWindowFrame^% ppWindowFrame
)
abstract OpenDocumentViaProject : 
        pszMkDocument:string * 
        rguidLogicalView:Guid byref * 
        ppSP:IServiceProvider byref * 
        ppHier:IVsUIHierarchy byref * 
        pitemid:uint32 byref * 
        ppWindowFrame:IVsWindowFrame byref -> int 
function OpenDocumentViaProject(
    pszMkDocument : String, 
    rguidLogicalView : Guid, 
    ppSP : IServiceProvider, 
    ppHier : IVsUIHierarchy, 
    pitemid : uint, 
    ppWindowFrame : IVsWindowFrame
) : int

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.
  • 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).
  • pitemid
    Type: System.UInt32%
    [out] Pointer to the hierarchy item identifier of the document in the project. For more information see VSITEMID.

Return Value

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsUIShellOpenDocument::OpenDocumentViaProject(
   [in] LPCOLESTR pszMkDocument,
   [in] REFGUID rguidLogicalView,
   [out] IServiceProvider **ppSP,
   [out] IVsUIHierarchy **ppHier,
   [out] VSITEMID *pitemid,
   [out, retval] IVsWindowFrame **ppWindowFrame
);

IVsUIShellOpenDocument.OpenDocumentViaProject can be called to open any project that is opened through the New Project or Open Project dialog box. In addition, this method is also called to open a document in any project that is added to the solution through AddVirtualProject or AddVirtualProjectEx. One example use of this is the DataView hierarchy, which is currently in Server Explorer. If a DataView hierarchy is added to the solution as a virtual project using AddVirtualProject, then the OpenDocumentViaProject method can open items from DataView hierarchies. This functionality is important as it makes debugging of stored procedures possible.

.NET Framework Security

See Also

Reference

IVsUIShellOpenDocument Interface

IVsUIShellOpenDocument Members

Microsoft.VisualStudio.Shell.Interop Namespace