Re: IRibbonExtensibility and custom ribbon image
- From: "NickP" <a@xxxxx>
- Date: Thu, 6 Sep 2007 17:04:28 +0100
Just to add to this, I've been trying to implement the onAction event of the
button via implementing the ICommandBarButtonEvents interface via the ATL
wizard. I thought if i could get this working then I would be half way to
getting the getImage callback working. Unfortunately even though I have
defined the function Click, I am being told that it is an abstract class, if
I remove the interface for ICommandBarButtonEvents the error disappears.
I don't see the problem as the interface is clearly defined,
...
struct __declspec(uuid("55f88890-7708-11d1-aceb-006008961da5"))
ICommandBarButtonEvents : IDispatch
{
//
// Raw methods provided by interface
//
virtual void __stdcall Click (
/*[in]*/ struct _CommandBarButton * Ctrl,
/*[in,out]*/ VARIANT_BOOL * CancelDefault ) = 0;
};
....
// ICommandBarButtonEvents Methods
public:
STDMETHOD_(void, Click)(CommandBarButton * Ctrl, BOOL * CancelDefault)
{
};
....
o_O, it's got me stumped that's for sure, I thought I understood this
interface implementation, especially as it has only 1 method!
Nick.
"NickP" <a@xxxxx> wrote in message
news:O3KMhsI8HHA.464@xxxxxxxxxxxxxxxxxxxxxxx
Hi there,
I've just seen a video, and read quite allot of articles saying how to
use a custom image for Ribbon button in .NET. Unfortunately I am using
VC2005, so cannot do this, how would I specify a custom bitmap?
STDMETHODIMP CConnect::raw_GetCustomUI(BSTR RibbonID, BSTR * RibbonXml)
{
if (!RibbonXml) return E_POINTER;
*RibbonXml = SysAllocString(L"<customUI
xmlns=\"http://schemas.microsoft.com/office/2006/01/customui\">"
L" <ribbon>"
L" <tabs>"
L" <tab id=\"my tab\""
L" label=\"my tab\">"
L" <group id=\"my ribbon\""
L" label=\"my ribbon\">"
L" <button id=\"foobar\""
L" image=\"<what do I enter here?>\""
L" size=\"large\""
L" label=\"foobar...\""
L" onAction=\"ButtonClicked\"/>"
L" </group>"
L" </tab>"
L" </tabs>"
L" </ribbon>"
L"</customUI>"
);
return (*RibbonXml ? S_OK : E_OUTOFMEMORY);
}
I'm thinking that I might have to use a callback, but again, I cannot
find any C++ examples of doing this. Many thanks in advance for your time
and help.
Nick.
.
- Follow-Ups:
- Re: IRibbonExtensibility and custom ribbon image
- From: SvenC
- Re: IRibbonExtensibility and custom ribbon image
- From: NickP
- Re: IRibbonExtensibility and custom ribbon image
- References:
- IRibbonExtensibility and custom ribbon image
- From: NickP
- IRibbonExtensibility and custom ribbon image
- Prev by Date: Re: IRibbonControl C++
- Next by Date: Re: IRibbonControl C++
- Previous by thread: IRibbonExtensibility and custom ribbon image
- Next by thread: Re: IRibbonExtensibility and custom ribbon image
- Index(es):
Loading