Adding ToolBars programmatically

G

Guest

I am trying to add custom tollbars to MSP and I'am having difficulties
getting at the _CommandBars. In the code below:

HRESULT hr = m_spApp->get_CommandBars(&spCmdBars) results in error:

get_CommandBars is not a member of CComQIPtr <Project1::_MSProject>,
at least according to documentation. Any advice will be appreciated.

STDMETHOD(OnConnection)(IDispatch * Application, ext_ConnectMode
ConnectMode, IDispatch * AddInInst, SAFEARRAY * * custom)
{

// QI() for _Application
CComQIPtr <Project1::_MSProject> spApp(Application);
ATLASSERT(spApp);

m_spApp = spApp;

// get the CommandBars interface that represents Outlook's
//toolbars & menu
//items
HRESULT hr = m_spApp->get_CommandBars(&spCmdBars);
if(FAILED(hr))
return hr;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top