IVsExternalFilesManager2::AddDocumentEx Method (UInt32, String^, IntPtr, IntPtr, Guid, String^, Guid, String^, String^, IServiceProvider^, IntPtr, Int32, IVsWindowFrame^)
Programmatically informs the Miscellaneous Files project to add a node, allows control over the icon for the node, and provides an opportunity for the editor to query for contextual services.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int AddDocumentEx( unsigned int dwCDW, String^ pszMkDocument, IntPtr punkDocView, IntPtr punkDocData, [InAttribute] Guid% rguidEditorType, String^ pszPhysicalView, [InAttribute] Guid% rguidCmdUI, String^ pszOwnerCaption, String^ pszEditorCaption, IServiceProvider^ pspContext, IntPtr hicon, [OutAttribute] int% pfDefaultPosition, [OutAttribute] IVsWindowFrame^% ppWindowFrame )
Parameters
- dwCDW
-
Type:
System::UInt32
[in] Defines the __VSCREATEDOCWIN flags, which determine how the document window is created.
- pszMkDocument
-
Type:
System::String^
[in] Path to the document. This path is used by the environment to register this view in the Running Document Table (RDT).
- punkDocView
-
Type:
System::IntPtr
[in] Pointer to the IUnknown interface for the document view object to be displayed within this window.
- punkDocData
-
Type:
System::IntPtr
[in] Pointer to the IUnknown interface of an object representing the document data object of this document in situations where there is view or data separation. For example, the core text editor has a text view object (VsTextView Object) and the text buffer object (VsTextBuffer Object). This parameter can be null. Passing null causes the environment to create an instance of a default implementation of the punkDocData on the caller's behalf.
- rguidEditorType
-
Type:
System::Guid
[in] Unique identifier of the editor factory that created an instance of the document view and document dataobjects. This should be GUID_NULL if the document is not constructed using an editor factory (that is, an instance is created with private knowledge of a particular project).
- pszPhysicalView
-
Type:
System::String^
[in] String to identify the physical view type for the editor.
- rguidCmdUI
-
Type:
System::Guid
[in] Specifies the GUID that indicates which set of menus should be merged into the main menu bar when this document is active. It is used for turning on visibility of commands and tool windows.
- pszOwnerCaption
-
Type:
System::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
-
Type:
System::String^
[in] Initial caption defined by the document editor for the document window. This is typically a string enclosed in square brackets (for example, [Read Only]). The initial value of this parameter is returned as an [out] parameter in the CreateEditorInstance Method.
- pspContext
-
Type:
Microsoft.VisualStudio.OLE.Interop::IServiceProvider^
[out] Pointer to the IServiceProvider interface. Can be null. This is an additional service provider provided by the caller (the Miscellaneous Files project) making it possible for the caller to provide extra context (by means of services) to the embedded editor. Thus, when the embedded object makes a service request, the frame attempts to satisfy this request. If the service is not provided by the frame, pSP is tried. If the service is not found there, then the environment's global service provider is queried.
- hicon
-
Type:
System::IntPtr
[in] Specifies a handle to an icon. Allows you to specify the icon for the Miscellaneous Project node.
- pfDefaultPosition
-
Type:
System::Int32
[out] Can be null if the caller does not desire the default position information for the window. true if the environment did not have any information saved about the last position of this tool window (that is, guidPersistenceSlot was not found), hence it was placed in some default location on the screen. false if this window was placed where the user last located and sized it.
- ppWindowFrame
-
Type:
Microsoft.VisualStudio.Shell.Interop::IVsWindowFrame^
[out] Pointer to the frame containing this editor, which can be used to manipulate the location, size, caption, and other properties of the window. It can also be used to get the IUnknown interface pointer of the embedding (that is, the punkDocView) or the punkDocData.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From vsshell.idl:
HRESULT IVsExternalFilesManager2::AddDocumentEx( [in] VSCREATEDOCWIN dwCDW, [in] LPCOLESTR pszMkDocument, [in] IUnknown *punkDocView, [in] IUnknown *punkDocData, [in] REFGUID rguidEditorType, [in] LPCOLESTR pszPhysicalView, [in] REFGUID rguidCmdUI, [in] LPCOLESTR pszOwnerCaption, [in] LPCOLESTR pszEditorCaption, [in] IServiceProvider *pspContext, [in] HICON hIcon, [out] BOOL *pfDefaultPosition, [out] IVsWindowFrame **ppWindowFrame );
Similar to AddDocument Method. Provides the additional functionality of specifying the Miscellaneous Projects icon and provides an opportunity for the editor to query for contextual services.