locked
Why Windows.CreateToolWindow function returned E_FAIL RRS feed

  • Question

  •        My code as follow:

    CComPtr<EnvDTE::Windows> pWindows;
    CComPtr<EnvDTE::Window> pWindow;
    CComPtr<IDispatch> pProgrammableObject;
    m_pDTE->get_Windows(&pWindows);
    
    HRESULT hr = S_OK;
    
    hr = pWindows->CreateToolWindow(m_pAddInInstance, CComBSTR("StatToolWin.StatDlg"), CComBSTR("Tool"), CComBSTR("{4C62F52D-F3AB-45C4-9545-65FBA8AB3EBA}"), &pProgrammableObject, &pWindow);
    if(NULL!=pWindow)
        pWindow->put_Visible(VARIANT_TRUE);
          when debug, the value of hr is  E_FAIL。Why Windows.CreateToolWindow function returned E_FAIL? how to get error information?


    前无古人,后无来者

    Sunday, October 6, 2013 4:47 AM

Answers

  • Have you registered your object under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\<version>\CLSID?

    Sunday, October 6, 2013 3:19 PM