Board index » delphi » Outlook 2003 Addin, EventSinkImp, Button OnClick
Nicolai Waniek
Delphi Developer |
Outlook 2003 Addin, EventSinkImp, Button OnClick2005-12-01 10:59:41 PM delphi236 Dear Newsgroup, I'm having a few troubles with correctly setting up my addin. A colleague of mine started this project and as he's not longer in the company any more, it is my turn to extend it. He used EventSinkImp to connect to the IConnectionPoint interfaces and derived a few more classes we need. For example he derived a TAddinOutlookButton from TOutlookCommandBarButton to store the Buttons Inspector of Explorer reference. Our plugin should be installed in each the CommandBar, the Explorer- and the Interface-Toolbar. My Colleague implemented the Menu we require for each of the three different toolbars and it was the hell to extend/change it because you had to do it three times each... I then started to reorganize the menu and saved the complete layout within an array (each item refers to it is parents ItemID so they have incremental IDs.. This all works very well and the menu is displayed properly, but I now have the following problem: Each time a menu gets created, the OnClick event of a single item will get called as often as it was built: So if we go for one creation in the explorer, one in the CommandBar and one in the Inspector and clicking on one item, it "get's clicked" three times! I tried it with a MessageDlg and let the menu for the CommandBar create it in every RefreshCommandBars event with the result that i get the Message Dialog as often as the Command Bar got created. Perhaps I should say that my colleague used OleVariants and IDispatches in a very bad way (he mixed it up as often as he could... *gna*) and maybe there are some wronge references. Any Idea why the Button get's clicked so often? And sorry for my english, it got a bit rusty the last few months ;) Best regards, Nicolai Waniek |