在PowerPoint2003的插件程序中添加Popup菜单的问题
请教一下:
在PowerPoint2003的插件程序中添加Popup菜单的时候出错.
开发环境: VC++ 6.0 + ATL3.0
在_IDTExtensibility2接口的OnConnection事件处理程序中,运行以下代码:
CComQIPtr <PPT::_Application> pApp(Application);
CComPtr <Office::_CommandBars> pCmdBars;
result = pApp->get_CommandBars(&pCmdBars);
if(FAILED(result))
return result;
ATLASSERT(pCmdBars);
CComPtr <Office::CommandBar> pCmdBar;
result = pCmdBars->get_ActiveMenuBar(&pCmdBar);
最后一行代码时的返回值result是0(代表成功),但取得的pCmdBar却是一个空指针。
此问题仅发生在PowerPoint 2003中,PowerPoint 2000及PowerPoint XP版中,取得的pCmdBar都是正确的指针。
请问那位高手知道原因?