How to: Open Project-Specific Editors
If an item file being opened by a project is intrinsically bound to the particular editor for that project, the project must open the file by using a project-specific editor. The file cannot be delegated down to the IDE's mechanism for selecting an editor. For example, instead of using a standard bitmap editor, you can use this project-specific editor option to specify a specific bitmap editor that recognizes information in the file that is unique to your project.
The IDE calls the OpenItem method when it determines that a file should be opened by a specific project. For more information, see Displaying Files By Using the Open File Command. Use the following guidelines to implement the OpenItem method to have your project open a file by using a project-specific editor.
To implement the OpenItem method with a project-specific editor
Call the FindAndLockDocument method (RDT_EditLock) to determine whether the file (document data object) is already open.
For more information about document data and document view objects, see Document Data and Document View in Custom Editors.
If the file is already open, resurface the file by calling the IsDocumentOpen method and specifying a value of IDO_ActivateIfOpen for the grfIDO parameter.
If the file is open and the document is owned by a project other than the calling project, a warning will be displayed to the user that the editor being opened is from another project. The file window is then surfaced.
If your text buffer (document data object) is already open and you want to attach another view to it, you are responsible for hooking up that view. The recommended approach to instantiating a view (document view object) from the project, is as follows:
Call the CreateDocumentWindow method, specifying your document view object.
This method sites the document view object in a document window.
At this point, the view should be fully initialized and ready to be opened.
Call the Show method to show and open the view.