Tuesday, January 20, 2009

IRibbonControl->get_Id Gives Access violation

While developing Custom Ribbon interface for excel we were Getting Access violation while calling function get_Id() in one of my control callback. Following is code snip for that


STDMETHOD(ButtonClicked)( IDispatch * RibbonControl)
{

CComQIPtr pRibbonControl;
pRibbonControl = RibbonControl;
BSTR bstr;
pRibbonControl->get_Id(&bstr);

....

above line was giving access violation in debug build. But it works in release build ...

So do not get blocked due to this...
}

I spent almost one day for this ...
Note: This was happening only on vs6

Thursday, January 8, 2009