V
Voyager
Hi!
I'm developing a Addin in VC++ to add a toolbar (and a button) to the email
Inspector... I Advise a "new inspector" on the NewInspector Event, adding it
the "Activate", "Deactivate" and "Close" event. But the same code crashes
when a 2nd Inspector is created (2 "new mail" windows) ...
Could someone help me?
void __stdcall CAddin::OnInspectors_NewInspector(IDispatch* Ctrl){
....
CComQIPtr<Outlook::_Inspector> spInspector(Ctrl);
// setup InspectorActivateEvent... --------------------
hr = Inspector_ActivateEvent:ispEventAdvise((IDispatch*)spInspector);
if(FAILED(hr))
ATLTRACE("Failed advising to ApplicationEvents");
// setup InspectorDeactivateEvent... -------------------------
hr = Inspector_DeactivateEvent:ispEventAdvise((IDispatch*)spInspector);
if(FAILED(hr))
ATLTRACE("Failed advising to ApplicationEvents");
// setup InspectorCloseEvent... ------------------
hr = Inspector_CloseEvent:ispEventAdvise((IDispatch*)spInspector);
if(FAILED(hr))
ATLTRACE("Failed advising to ApplicationEvents");
....
}
I'm developing a Addin in VC++ to add a toolbar (and a button) to the email
Inspector... I Advise a "new inspector" on the NewInspector Event, adding it
the "Activate", "Deactivate" and "Close" event. But the same code crashes
when a 2nd Inspector is created (2 "new mail" windows) ...
Could someone help me?
void __stdcall CAddin::OnInspectors_NewInspector(IDispatch* Ctrl){
....
CComQIPtr<Outlook::_Inspector> spInspector(Ctrl);
// setup InspectorActivateEvent... --------------------
hr = Inspector_ActivateEvent:ispEventAdvise((IDispatch*)spInspector);
if(FAILED(hr))
ATLTRACE("Failed advising to ApplicationEvents");
// setup InspectorDeactivateEvent... -------------------------
hr = Inspector_DeactivateEvent:ispEventAdvise((IDispatch*)spInspector);
if(FAILED(hr))
ATLTRACE("Failed advising to ApplicationEvents");
// setup InspectorCloseEvent... ------------------
hr = Inspector_CloseEvent:ispEventAdvise((IDispatch*)spInspector);
if(FAILED(hr))
ATLTRACE("Failed advising to ApplicationEvents");
....
}