Re: How to intercept the "ItemEvents"

From: Dmitry Streblechenko \(MVP\) (dmitry_at_dimastr.com)
Date: 08/05/04


Date: Thu, 5 Aug 2004 15:06:29 -0700

You will get what you have now - your handler will be called multiple times.

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

"Alexander Chen" <elpelado001@hotmail.com> wrote in message
news:O1VZiSseEHA.724@TK2MSFTNGP10.phx.gbl...
> If I don't set tag for each instance of the button, will it bring my addin
> any bad influence ?
>
>
> "Dmitry Streblechenko (MVP)" <dmitry@dimastr.com> wrote in message
> news:u$5xuWqeEHA.3840@TK2MSFTNGP10.phx.gbl...
> > You need to set the CommandBarButton.Tag property to a unique string for
> > each instance of the button.
> >
> > Dmitry Streblechenko (MVP)
> > http://www.dimastr.com/
> > OutlookSpy - Outlook, CDO
> > and MAPI Developer Tool
> >
> >
> > "Alexander Chen" <elpelado001@hotmail.com> wrote in message
> > news:%23fHKAbpeEHA.2440@tk2msftngp13.phx.gbl...
> > >
> > > I want to ask you another question. you said "you need to have
> separately
> > > > advise sinks for each instance of a button since you can have
multiple
> > > > inspectors or explorers open". But in my project, I can only advise
> sink
> > > for a button once, although I have multiple inspectors open. If I
> adivise
> > > sinks for each instance of a button in multiple inspectors, in the
first
> > > inpector,the button runs ok, but in the second inspector, the button
> will
> > > respond for a click twice, in the third, it will respond the event
> thrice.
> > > Why? By the way, I do not appoint tag for the button .
> > >
> > >
> > > "Dmitry Streblechenko (MVP)" <dmitry@dimastr.com> wrote in message
> > > news:#abvxbYeEHA.708@TK2MSFTNGP09.phx.gbl...
> > > > If you want to intercept the events on all messages, you'd have to
set
> > > > advise sinks on each message that you want to monitor, there is no
way
> > > > around it.
> > > > What kind of events are you trying to intercept? If it is something
> > caused
> > > > by a user, track Explorer.SelectionChange event, release old advise
> > sinks,
> > > > then set new advise sinks on each selected message. Or you can use
the
> > > > MAPIFolder.Items events on each folder that you are interested in.
> > > > And BTW, buttons are exactly like messages - you need to have
separate
> > > > advise sinks for each instance of a button since you can have
multiple
> > > > inspectors or explorers open.
> > > >
> > > > Dmitry Streblechenko (MVP)
> > > > http://www.dimastr.com/
> > > > OutlookSpy - Outlook, CDO
> > > > and MAPI Developer Tool
> > > >
> > > >
> > > > "Alexander Chen" <elpelado001@hotmail.com> wrote in message
> > > > news:eCovE8ReEHA.2764@TK2MSFTNGP11.phx.gbl...
> > > > > I want to intercept Outlook::ItemEvents triggerd by
> _MailItem
> > > > > objects in my addin,but I encounter a difficulty. if I use
> > > > > IDispEventSimpleImpl or IDispEventImpl in my addin class, I must
> > specify
> > > a
> > > > > unique identifier for every _MailItem object. You know, the
> _MailItem
> > > > object
> > > > > does not like the button object, its number can change and it also
> can
> > > be
> > > > > created or destroyed during using outlook, so I can not specify a
> > > > identifier
> > > > > for every _MailItem object when I implement my addin class.
> > > > > Who can help me resolve this difficulty?
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: MAPILogonEx() with multiple Profiles or HrMailboxLogon()
    ... OutlookSpy - Outlook, CDO ... and MAPI Developer Tool ... ExchangeServer-MessageStores of multiple users. ... Exchange SDK with these headers/docs? ...
    (microsoft.public.win32.programmer.messaging)
  • Re: Capturing outlook events not working with C++
    ... Do you keep the folders variable alive at all times? ... OutlookSpy - Outlook, CDO ... and MAPI Developer Tool ... > However, when I try to set an Advise sink for a MAPIFolder's FolderEvents, ...
    (microsoft.public.outlook.program_addins)
  • Re: How to set multiple reply-to addresses in MAPI ?
    ... So my problem is how should I go about for implementing multiple ... Any differences that you can see using MFCMAPI or OutlookSpy? ... We need to get multiple entry IDs, ... // 2) Allocate a FLATENTRYLIST object which contains each FLATENTRY ...
    (microsoft.public.win32.programmer.messaging)
  • Re: How to set multiple reply-to addresses in MAPI ?
    ... So my problem is how should I go about for implementing multiple ... Dmitry Streblechenko wrote: ... Any differences that you can see using MFCMAPI or OutlookSpy? ... // 2) Allocate a FLATENTRYLIST object which contains each FLATENTRY ...
    (microsoft.public.win32.programmer.messaging)
  • Re: UnExplained ATLASSERT by IDispEventImpl::DispEventAdvise/UnAdvise
    ... IDispatchImpl and IDispEventImpl. ... However, If I have HTML with multiple frames, and I attempt to sink ... You can't advise the same sink to multiple sources. ...
    (microsoft.public.vc.atl)