Z
Zhenxin Li
Hello,
I write an addin(C++) for Outlook 10. It catchs NewInsepctor event and add a
new toolbar button for the new inspector.
When I install this addin on Outlook 11. The addin fails when it advise
event sink for NewInspector event.
The following is a piece of codes.
void __stdcall CConnect::OnNewInspector(IDispatch* /*Outlook::_Inspector* */
pCtrl)
{
HRESULT hResult;
CComQIPtr<Outlook::_Inspector> pInspector(pCtrl);
CComQIPtr<IConnectionPointContainer> pInspectorCPC;
CComPtr<IConnectionPoint> pInspectorCP;
DWORD dwCookie;
// Advise InspectorEvents sink...
pInspectorCPC = pInspector;
if ( pInspectorCPC == NULL )
{
ATLTRACE2("CConnect::OnNewInspector: Failed get connection point container
for inspector!\n");
return;
}
if ( FAILED(hResult =
pInspectorCPC->FindConnectionPoint(__uuidof(Outlook::InspectorEvents),
&pInspectorCP)) )
{
ATLTRACE2("CConnect::OnNewInspector: Failed get connection point for
inspector!\n");
return;
}
if ( FAILED(hResult =
pInspectorCP->Advise((IUnknown*)m_pInspectorEventsHandler, &dwCookie)) )
{
ATLTRACE2("CConnect::OnNewInspector: Failed advise event sink for
inspector!\n");
return;
}
/**************** Above "if" Failed!!!!!!!!!!!!! ****************/
....
}
Isn't Outlook 11 object model compatible with Outlook 10?
Thanks!
zxli
I write an addin(C++) for Outlook 10. It catchs NewInsepctor event and add a
new toolbar button for the new inspector.
When I install this addin on Outlook 11. The addin fails when it advise
event sink for NewInspector event.
The following is a piece of codes.
void __stdcall CConnect::OnNewInspector(IDispatch* /*Outlook::_Inspector* */
pCtrl)
{
HRESULT hResult;
CComQIPtr<Outlook::_Inspector> pInspector(pCtrl);
CComQIPtr<IConnectionPointContainer> pInspectorCPC;
CComPtr<IConnectionPoint> pInspectorCP;
DWORD dwCookie;
// Advise InspectorEvents sink...
pInspectorCPC = pInspector;
if ( pInspectorCPC == NULL )
{
ATLTRACE2("CConnect::OnNewInspector: Failed get connection point container
for inspector!\n");
return;
}
if ( FAILED(hResult =
pInspectorCPC->FindConnectionPoint(__uuidof(Outlook::InspectorEvents),
&pInspectorCP)) )
{
ATLTRACE2("CConnect::OnNewInspector: Failed get connection point for
inspector!\n");
return;
}
if ( FAILED(hResult =
pInspectorCP->Advise((IUnknown*)m_pInspectorEventsHandler, &dwCookie)) )
{
ATLTRACE2("CConnect::OnNewInspector: Failed advise event sink for
inspector!\n");
return;
}
/**************** Above "if" Failed!!!!!!!!!!!!! ****************/
....
}
Isn't Outlook 11 object model compatible with Outlook 10?
Thanks!
zxli