Simplified Embedding

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Simplified Embedding.

Simplified embedding is enabled in an editor when its document view object is parented to (that is, made a child of) Visual Studio, and the IVsWindowPane interface is implemented to handle its window commands. Simplified embedding editors cannot host active controls. The objects used to create an editor with simplified embedding are shown in the following illustration.

Simplified Embedding Editor graphic
Editor with simplified embedding

System_CAPS_ICON_note.jpg Note

Of the objects in this illustration, only the CYourEditorFactory object is required to create a standard file-based editor. If you are creating a custom editor, you are not required to implement IVsPersistDocData2, because your editor will likely have its own private persistence mechanism. For non-custom editors, however, you must do so.

All interfaces implemented to create an editor with simplified embedding are contained in the CYourEditorDocument object. However, to support multiple views of document data, split the interfaces onto separate data and view objects as indicated in the following table.

InterfaceLocation of interfaceUse
IVsWindowPaneViewProvides connection to the parent window.
IOleCommandTargetViewHandles commands.
IVsStatusbarUserViewEnables status bar updates.
IVsToolboxUserViewEnables Toolbox items.
IVsFileChangeEventsDataSends notifications when the file changes.
IPersistFileFormatDataEnables the Save As feature for a file type.
IVsPersistDocData2DataEnables persistence for the document.
IVsDocDataFileChangeControlDataAllows suppression of file change events, such as reload triggering.
Show: