Hello,
Not quite .. when I press a button my C++ OnAction function is called, and
as I understand it I should be passed a pointer to an IButtonControl.
Ribbon::IRibbonControlPtr pCtrl = NULL;
(LPDISPATCH)(pDispParams->rgvarg[0].pdispVal)->QueryInterface(Ribbon::IID_IRibbonControl,
(LPVOID *)&pCtrl);
OLECHAR * szId = L"Id";
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
DISPID dspid;
VARIANT vtResult;
hr = pCtrl->GetIDsOfNames(IID_NULL, &szId, 1, LOCALE_SYSTEM_DEFAULT,
&dspid);
hr = pCtrl->Invoke(dspid, IID_NULL, LOCALE_SYSTEM_DEFAULT,
DISPATCH_PROPERTYGET, &dispparamsNoArgs, &vtResult, NULL, NULL);
The GetIDsOfName returns S_OK aand a dispid of 1 (which looks correct)
The Invoke on the IButtonControl fails with an error code of 800a01a8
(something about object required)
Wei Lu said:
Hello Michael,
I would like to know this issue more clearly.
1.Do you mean that when you try to click the Button to invoke your
callback
and you get the error message?
2. What does your OnAction do? Could you post the content here?
3. If you only try to show a MessageBox in the OnAction, did this issue
appeared?
The whole code of your add-in will be appreciated so that I can do further
troubleshoot.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.