Re: IRibbonExtensibility integration issue for unmanaged AddIn

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Sadly it did work at first, but now for some reason the Callback Interface isn't accessed anymore at all.
As there are no error messages for onAction as well as loadImage methods i guess Outlook doesn't even call the callback interfaces Invoke-implementation.
After more then a day of trying different things i am again out of clues.
Only thing i can imagine is that Outlooks QueryInterface for IDispatch does not return the ICallBackInterface - but that should be taken care of by COM_INTERFACE_ENTRY2().

The Ole/COM-Object Viewer shows everything seems to be fine, wether i view the dlls typelib directly or the registered typelib.
Also the not Ribbon-Specific code and IRibbonExtensibility still work fine.

Any hints would be appreciated.

The simplified relevant source and IDL (taken from the Object Viewer):

class ATL_NO_VTABLE CAddin :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CAddin, &CLSID_Addin>,
public IDispatchImpl<IDTExtensibility2, &IID__IDTExtensibility2, &LIBID_AddInDesignerObjects, 1, 0>,
public IDispatchImpl<IRibbonExtensibility, &__uuidof(IRibbonExtensibility), &LIBID_Office , /* wMajor = */ 2, /* wMinor = */ 4>,
public IDispatchImpl<ICallbackInterface, &__uuidof(ICallbackInterface), &LIBID_OUTLOOKADDINLib, /* wMajor = */ 1, /* wMinor = */ 0>,
[... IDispEventSimpleImpl<>s ...]
{
[...]
BEGIN_COM_MAP(CAddin)
COM_INTERFACE_ENTRY2(IDispatch, ICallbackInterface)
COM_INTERFACE_ENTRY(IDTExtensibility2)
COM_INTERFACE_ENTRY(IRibbonExtensibility)
COM_INTERFACE_ENTRY(ICallbackInterface)
END_COM_MAP()
[...]
};
OBJECT_ENTRY_AUTO(__uuidof(Addin), CAddin)



[
uuid(...), version(1.0),
helpstring("Outlook Addin 1.0 library")
]
library OUTLOOKADDINLib
{
importlib("stdole2.tlb");

interface ICallbackInterface;

[
uuid(...),
helpstring("Addin Class")
]
coclass Addin {
[default] interface IUnknown;
};
[
uuid(...),
helpstring("CallbackInterface Class")
]
coclass CallbackInterface { // most probably not needed
[default] interface ICallbackInterface;
};
[
odl, uuid(...),
helpstring("ICallbackInterface Interface"),
dual, nonextensible, oleautomation
]
interface ICallbackInterface : IDispatch {
[id(0x00000001), helpstring("method ButtonClicked")]
HRESULT ButtonClicked([in] IDispatch* RibbonControl);
};

[...]
};


.


Quantcast