IRibbonExtensibility and custom ribbon image

S

SvenC

Hi Nick,
Okay, stepping through the names of the functions, it does not appear
to have ButtonClicked cached in m_pMap. There are 8 in total, these are,

GetCustomUI
Invoke
GetIDsOfNames
GetTypeInfo
GetTypeInfoCount
Release
AddRef
QueryInterface

We are comming closer! That is the IDispatch list of IRibbonExtensibility,
not of your custom ICallbackInterface, hence Office is not seeing the
ButtonClicked method. Actually COM does not allow an object to have
different implementations of a single interface and here you see one reason:
which IDispatch should be returned when QI(IID_IDispatch) is executed. COM
defines that QIs on any interface pointer to an object should always return
the same thing.
In ATL you can tweak that with the COM interface map. I get the feeling that
the sequence is important. Try to put COM_INTERFACE_ENTRY2(IDispatch,
ICallbackInterface) as the first entry. Can you post your complete interface
map
 
N

NickP

Aaaah!!!! You genius!!

All that time and it was 2 lines round the wrong way!!?! Damn, don't you
just love programming?

Many many thanks for your time, you have helped me no end! I owe you a
beer! LOL!

Cheers.

Nick.
 
S

SvenC

Aaaah!!!! You genius!!
All that time and it was 2 lines round the wrong way!!?! Damn, don't you
just love programming?

Many many thanks for your time, you have helped me no end! I owe you a
beer! LOL!

You're welcome - good to hear its working now :)
 

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