Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   Advise more than one interface (http://www.outlookbanter.com/add-ins-outlook/53819-advise-more-than-one-interface.html)

MON205 August 1st 07 02:56 PM

Advise more than one interface
 
Hello all,
In my outlook add-in, I want to catch the event when adding items to some
folders (e.g. Deleted Items in all PSTs).
My solution depend on monitoring the Items collections of these folders.
I inherited my class from IDispEventSimpleImpl to handle the
Outlook::ItemsEvents.
Now, can I use this class (just one) to monitor more than a folder items? I
noticed that if I called the DispEventAdvise more than a time it returns
E_UNEXPECTED. How can I do this knowing that the number of folders I want to
monitor is not fixed.

Dmitry Streblechenko August 1st 07 05:39 PM

Advise more than one interface
 
Create a class wrapping the advise sink and whatever else you need to store
on the per-folder level. Create an instance of that class for each folder
that you need to monitor.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"MON205" wrote in message
...
Hello all,
In my outlook add-in, I want to catch the event when adding items to some
folders (e.g. Deleted Items in all PSTs).
My solution depend on monitoring the Items collections of these folders.
I inherited my class from IDispEventSimpleImpl to handle the
Outlook::ItemsEvents.
Now, can I use this class (just one) to monitor more than a folder items?
I
noticed that if I called the DispEventAdvise more than a time it returns
E_UNEXPECTED. How can I do this knowing that the number of folders I want
to
monitor is not fixed.




MON205 August 2nd 07 08:48 AM

Advise more than one interface
 
Very very nice.... It works just fine now.
Thanks Mr. Dmitry

"Dmitry Streblechenko" wrote:

Create a class wrapping the advise sink and whatever else you need to store
on the per-folder level. Create an instance of that class for each folder
that you need to monitor.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"MON205" wrote in message
...
Hello all,
In my outlook add-in, I want to catch the event when adding items to some
folders (e.g. Deleted Items in all PSTs).
My solution depend on monitoring the Items collections of these folders.
I inherited my class from IDispEventSimpleImpl to handle the
Outlook::ItemsEvents.
Now, can I use this class (just one) to monitor more than a folder items?
I
noticed that if I called the DispEventAdvise more than a time it returns
E_UNEXPECTED. How can I do this knowing that the number of folders I want
to
monitor is not fixed.






All times are GMT +1. The time now is 12:31 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com