我正在使用Word / Exce / PowerPoint加载项,该加载项已安装在客户PC上。
我有以下问题:
可以在C#/ VB / C ++版本中创建后台菜单控件项目模板。但是,只能在C#中创建加载项项目。有没有办法构建到C ++项目中?
如何在C ++ / ATL项目中控制后台菜单?我创建了“共享的加载项”项目,并将其成功加载到MSWord中,但是从未调用过“ GetCustomUI”功能。
这是代码:
class ATL_NO_VTABLE CConnect :
...
public IDispatchImpl<AddInDesignerObjects::_IDTExtensibility2, &AddInDesignerObjects::IID__IDTExtensibility2, &AddInDesignerObjects::LIBID_AddInDesignerObjects, 1, 0>,
public IDispatchImpl<IRibbonExtensibility, &__uuidof(IRibbonExtensibility), &LIBID_Office, /* wMajor = */ 2, /* wMinor = */ 4>
...
BEGIN_COM_MAP(CConnect)
COM_INTERFACE_ENTRY2(IDispatch, IRibbonExtensibility)
COM_INTERFACE_ENTRY(AddInDesignerObjects::IDTExtensibility2)
COM_INTERFACE_ENTRY(IRibbonExtensibility)
END_COM_MAP()
...
STDMETHOD(GetCustomUI)(BSTR RibbonID, BSTR * RibbonXml)
{
// never called
return S_OK;
}
...