Compartir a través de


IVsUIShellOpenDocument.InitializeEditorInstance Method

Definition

Initializes an instance of the document editor.

public:
 int InitializeEditorInstance(System::UInt32 grfIEI, IntPtr punkDocView, IntPtr punkDocData, System::String ^ pszMkDocument, Guid % rguidEditorType, System::String ^ pszPhysicalView, Guid % rguidLogicalView, System::String ^ pszOwnerCaption, System::String ^ pszEditorCaption, Microsoft::VisualStudio::Shell::Interop::IVsUIHierarchy ^ pHier, System::UInt32 itemid, IntPtr punkDocDataExisting, Microsoft::VisualStudio::OLE::Interop::IServiceProvider ^ pSPHierContext, Guid % rguidCmdUI, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsWindowFrame ^ % ppWindowFrame);
public int InitializeEditorInstance (uint grfIEI, IntPtr punkDocView, IntPtr punkDocData, string pszMkDocument, ref Guid rguidEditorType, string pszPhysicalView, ref Guid rguidLogicalView, string pszOwnerCaption, string pszEditorCaption, Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy pHier, uint itemid, IntPtr punkDocDataExisting, Microsoft.VisualStudio.OLE.Interop.IServiceProvider pSPHierContext, ref Guid rguidCmdUI, out Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame ppWindowFrame);
abstract member InitializeEditorInstance : uint32 * nativeint * nativeint * string * Guid * string * Guid * string * string * Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy * uint32 * nativeint * Microsoft.VisualStudio.OLE.Interop.IServiceProvider * Guid * IVsWindowFrame -> int
Public Function InitializeEditorInstance (grfIEI As UInteger, punkDocView As IntPtr, punkDocData As IntPtr, pszMkDocument As String, ByRef rguidEditorType As Guid, pszPhysicalView As String, ByRef rguidLogicalView As Guid, pszOwnerCaption As String, pszEditorCaption As String, pHier As IVsUIHierarchy, itemid As UInteger, punkDocDataExisting As IntPtr, pSPHierContext As IServiceProvider, ByRef rguidCmdUI As Guid, ByRef ppWindowFrame As IVsWindowFrame) As Integer

Parameters

grfIEI
UInt32

[in] Flags controlling the initialization of the editor. For a list of enumeration values, see __VSIEIFLAGS. If you specify a value of IEI_DoNotLoadDocData for this parameter, then this method does not attempt to load your DocData by calling LoadDocData(String).

punkDocView
IntPtr

nativeint

[in] Pointer to the IUnknown interface of the document data object.

punkDocData
IntPtr

nativeint

[in] Pointer to the IUnknown interface of the document data object.

pszMkDocument
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.

rguidEditorType
Guid

[in]GUID of the editor type.

pszPhysicalView
String

[in] Name of the physical view.

rguidLogicalView
Guid

[in] GUID identifying the logical view. For a list of logical view GUIDS, see Logical View and Physical View. If you implement IVsMultiViewDocumentView on your document data object, then the value passed into the rguidLogicalView parameter determines which view is activated when the editor window is displayed. The editor window is displayed when the editor is instantiated. By specifying the logical view GUID, the caller of IVsUIShellOpenDocument::InitializeEditorInstance can request the specific view that matches the reason the caller is requesting the view. For example, the caller would specify LOGVIEWID_Debugging to get the view appropriate for debugging view, or LOGVIEWID_TextView to get the view appropriate for the text editor (that is, a view that implements IVsCodeWindow).

pszOwnerCaption
String

[in] Initial caption defined by the document owner (that is, the project) for the document window. This is often of the format: "ProjectName – ItemName."

pszEditorCaption
String

[in] Initial caption defined by the document editor for the document window. This is typically a string enclosed in square brackets (for example, [Form]). The initial value of this parameter is returned as an [out] parameter in the CreateEditorInstance(UInt32, String, String, IVsHierarchy, UInt32, IntPtr, IntPtr, IntPtr, String, Guid, Int32) method.

pHier
IVsUIHierarchy

[in] Pointer to the IVsUIHierarchy interface of the project that contains the document.

itemid
UInt32

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

punkDocDataExisting
IntPtr

nativeint

[in] Pointer to the IUnknown interface of the document data object if the document data object already exists in the running document table.

pSPHierContext
IServiceProvider

[in] Project-specific service provider. For more information, see IServiceProvider.

rguidCmdUI
Guid

[in] Command UI GUID of the commands to display for this editor.

ppWindowFrame
IVsWindowFrame

[out, retval] The window frame that contains the editor. For more information, see IVsWindowFrame.

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsUIShellOpenDocument::InitializeEditorInstance(  
   [in] VSIEIFLAGS grfIEI,  
   [in] IUnknown *punkDocView,  
   [in] IUnknown *punkDocData,  
   [in] LPCOLESTR pszMkDocument,  
   [in] REFGUID rguidEditorType,  
   [in] LPCOLESTR pszPhysicalView,  
   [in] REFGUID rguidLogicalView,  
   [in] LPCOLESTR pszOwnerCaption,  
   [in] LPCOLESTR pszEditorCaption,  
   [in] IVsUIHierarchy *pHier,  
   [in] VSITEMID itemid,  
   [in] IUnknown *punkDocDataExisting,  
   [in] IServiceProvider *pSPHierContext,  
   [in] REFGUID rguidCmdUI,  
   [out, retval] IVsWindowFrame **ppWindowFrame  
);  

Editors can be initialized for file-based documents and non file-based documents. Because IVsUIShellOpenDocument.InitializeEditorInstance takes pszMkDocumentString as an input parameter, this method supports initializing both file-based and non file-based editors.

IVsUIShellOpenDocument.InitializeEditorInstance is a helper function called by CreateEditorInstance. InitializeEditorInstance calls the following methods in order:

Applies to