PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

_CommandBarButtonEvents_ClickEventHandler fires multiple times

 
 
Markus Kraemer
Guest
Posts: n/a
 
      14th Aug 2003
Hi,

I have an outlook addin setting up a new commandbar each time a new
inspector is created (outlook 2000).
The CommandBarButtons are hold in static variables within
connect-class.
If the CommandBarButtons still exists, the found Buttons are set to
the static
variables again. Each time the inspector is launched the Click-events
are bound
to the same OnClickMethod.

My problem:
If I launch three inspectors (no matter if they are closed or not)
clicking on
a CommandBarButton will cause the OnClickMethod to be executed three
times.

I thing I've done ervery thing as descriped in microsoft sample
"Developing .NET Smart Clients for Microsoft Office XP".

What's wrong. Is it necessary to unregister the click-events each time
an
inspector is closed? I do this ony when outlook is terminated.

thanks in advance
Markus Kraemer
 
Reply With Quote
 
 
 
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      14th Aug 2003
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


"Markus Kraemer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have an outlook addin setting up a new commandbar each time a new
> inspector is created (outlook 2000).
> The CommandBarButtons are hold in static variables within
> connect-class.
> If the CommandBarButtons still exists, the found Buttons are set to
> the static
> variables again. Each time the inspector is launched the Click-events
> are bound
> to the same OnClickMethod.
>
> My problem:
> If I launch three inspectors (no matter if they are closed or not)
> clicking on
> a CommandBarButton will cause the OnClickMethod to be executed three
> times.
>
> I thing I've done ervery thing as descriped in microsoft sample
> "Developing .NET Smart Clients for Microsoft Office XP".
>
> What's wrong. Is it necessary to unregister the click-events each time
> an
> inspector is closed? I do this ony when outlook is terminated.
>
> thanks in advance
> Markus Kraemer



 
Reply With Quote
 
Markus Kraemer
Guest
Posts: n/a
 
      15th Aug 2003
Thanks very much. It works ;-)

Markus Krämer


"Dmitry Streblechenko" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> 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
>
>
> "Markus Kraemer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi,
> >
> > I have an outlook addin setting up a new commandbar each time a new
> > inspector is created (outlook 2000).
> > The CommandBarButtons are hold in static variables within
> > connect-class.
> > If the CommandBarButtons still exists, the found Buttons are set to
> > the static
> > variables again. Each time the inspector is launched the Click-events
> > are bound
> > to the same OnClickMethod.
> >
> > My problem:
> > If I launch three inspectors (no matter if they are closed or not)
> > clicking on
> > a CommandBarButton will cause the OnClickMethod to be executed three
> > times.
> >
> > I thing I've done ervery thing as descriped in microsoft sample
> > "Developing .NET Smart Clients for Microsoft Office XP".
> >
> > What's wrong. Is it necessary to unregister the click-events each time
> > an
> > inspector is closed? I do this ony when outlook is terminated.
> >
> > thanks in advance
> > Markus Kraemer

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
worksheet_change event fires multiple times timconstan Microsoft Excel Programming 0 6th Oct 2004 03:59 PM
Re: AuthenticateRequest fires multiple times Scott Allen Microsoft ASP .NET 0 12th Aug 2004 06:40 PM
Re: AuthenticateRequest fires multiple times Karl Microsoft ASP .NET 0 12th Aug 2004 04:34 PM
Re: AuthenticateRequest fires multiple times tma Microsoft ASP .NET 0 12th Aug 2004 04:06 PM
Item_Write fires multiple times on Send Neil Dittmar Microsoft Outlook Form Programming 0 30th Dec 2003 02:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:18 PM.