RibbonX: Adding Custom Image to a Button in VC++

D

Devansh

Hi there,
I am developing a COM outlook addin implementing IRibbonExtensibility
interface.
In the XML code which I am using to show my GUI in Ribbon has a button
which is as follows,

<button id="CustomButton"
getImage="OnGetImage"
size="large"
label="Click me 1!"
onAction="ButtonClicked"/>

I am using a callbackinterface with name ICallbackInterface to have my
callbacks like ButtonClicked. My callback function ButtonClicked is
working.

My question here is, how do I use "getImage" tag or how and where and
what do I define in "OnGetImage" even handler in VC++. I could not
find any sample code which I could use.

Do I need to prototype "OnGetImage" function even handler also into
the IDL file same as "ButtonClicked"?
If no then how, what and where I am going to write it?
If yes then what I am going to write into it?

I hope I am clear in explaining my problem. In case of any
miscommunication kindly let me know.

In one line my question is, How to attach a custom image to a button
created in Ribbon in VC++?

Kindly help me in this.

Thanks,
Devansh
 
K

Ken Slovak - [MVP - Outlook]

The callback should be in the same module as your other callbacks.

I don't do C++ but in C# the signature of the getImage callback would be:

public stdole.IPictureDisp getImage(IRibbonControl control)
{
}

where control is the specific control that is requesting an image.

The image must be passed back as an IPictureDisp object, which can only be
done in the same process since IPictureDisp objects cannot be passed across
process boundaries.
 

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