Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

VS2012 creating a ToolWindowPane via an EditorFactory

$
0
0

Hello,

I create a WindowPane hosting an own editor to edit a custom file ".isql".
When I double click on a .isql file my custom editor opens, so far so good.

I want to a have Toolbar at top of my editor (like in a ToolWindowPane) but I don't know how to achieve this ...

I found a post from 2006 where it is advised  to use pVSShell->SetupToolbar.
I have no idea where I should call this, neither where I get the handle from as my editor is WPF based.

In the EditorFactory it looks like

 int IVsEditorFactory.CreateEditorInstance(uint grfCreateDoc, string pszMkDocument, string pszPhysicalView, IVsHierarchy pvHier, uint itemid, System.IntPtr punkDocDataExisting, out System.IntPtr ppunkDocView, out System.IntPtr ppunkDocData, out string pbstrEditorCaption, out System.Guid pguidCmdUI, out int pgrfCDW)
        {
            // Initialize to null
            ppunkDocView = IntPtr.Zero;
            ppunkDocData = IntPtr.Zero;
            pguidCmdUI = GuidList.guidiSQLEditorFactory;
            pgrfCDW = 0;

...

            // Create the Document (editor)
            SQLEditorPane newEditor = new SQLEditorPane();

            ppunkDocView = Marshal.GetIUnknownForObject(newEditor);
            ppunkDocData = Marshal.GetIUnknownForObject(newEditor);
            pbstrEditorCaption = "";

            return VSConstants.S_OK;
        }

Any ideas?


best regards Stephan Hartmann ML-Software GmbH


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>