View Single Post
  #1  
Old November 26th 07, 06:59 PM posted to microsoft.public.outlook.program_addins
Voyager
external usenet poster
 
Posts: 1
Default Problem with multiple Inspectors

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){
....
CComQIPtrOutlook::_Inspector spInspector(Ctrl);
// setup InspectorActivateEvent... --------------------
hr = Inspector_ActivateEvent:ispEventAdvise((IDispatc h*)spInspector);
if(FAILED(hr))
ATLTRACE("Failed advising to ApplicationEvents");

// setup InspectorDeactivateEvent... -------------------------
hr = Inspector_DeactivateEvent:ispEventAdvise((IDispa tch*)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");
....
}
Ads