Outlook Explorer Commandbarbutton - click-event 2 times?

Add-in Express™ Support Service
That's what is more important than anything else

Outlook Explorer Commandbarbutton - click-event 2 times?
 
Bert Stomphorst


Guest


Hi,

I've created an outlook com add-in, using Visual studio 2003 (.NET 1.1). In the add-in I created an explorer-commandbar with two buttons. In the click-event I open a winform using:
Dim _wizardForm As WizardForm
_wizardForm.ShowDialog()

This works fine, but From the wizardform I had to open an Inspector-window, which was not possible because of the ShowDialog. So I changed the code to:
Dim _wizardForm As WizardForm
_wizardForm.Show()

But now, when I click the commandbarbutton, the click-event is called twice. (tried with breakpoints).

When I add a Thread.Sleep(5000) in the eventhandler, the event is called once, but with a Thread.Sleep(1000) the event is still called twice.

My question: What's the reason for this behaviour, and how can I solve this issue?

thank you,
Bert

Posted 19 Nov, 2005 09:51:50 Top
Bert Stomphorst


Guest


Some extra info: I tried using a counter to handle the event only once, but it seems that there are two seperate threads that call the eventhandler, so this trick doesn't work.
Posted 19 Nov, 2005 09:57:00 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Bert.

Do you use a C++ shim for the add-in?
Posted 21 Nov, 2005 06:03:33 Top
Bert Stomphorst


Guest


Hi Sergey,

Yes I do.
Posted 23 Nov, 2005 01:25:19 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Bert.

Could you check the ShimProgID property of the add-in module? It should be set to the <PropgID> of your shim project. I think that for some reason your add-in was registered twice in the system registry. Please check the following key:
HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\AddIns\<the add-in progid>
I assume you will see the ProgIDs of the addinmodule and shim registered at the same time. It can be a cause of the issue. Try to delete an entry with the addinmodule progId. It should help.
Posted 23 Nov, 2005 05:49:39 Top
Bert Stomphorst


Guest


Hi Sergey,

sorry for the late reply, but this was exactly the problem.

Thank you!
Bert
Posted 28 Nov, 2005 09:09:02 Top