WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Using Ribbon in Inspector window

 
   Home -> Office -> Program Add-Ins RSS
Next:  signature block  
Author Message
tnemec78

External


Since: May 21, 2009
Posts: 2



(Msg. 1) Posted: Thu May 21, 2009 7:21 am
Post subject: Using Ribbon in Inspector window
Archived from groups: microsoft>public>outlook>program_addins (more info?)

Hi,
Firstly let me thank you for your feedback in this group thus far. I
really appreciate it.
I managed to write a COM Add-in in C++ that has a toolbar with buttons
in every Explorer/Inspector window.

My architecture is as follows:

CAddin - implements _IDTExtensibility2, has handlers for
OnNewExplorer, OnNewInspector
CExplorerWrapper - wrapper class for explorer events
(OnSelectionChange, OnClose, ...)
CInspectorWrapper - wrapper class for inspector events (OnActivate,
OnClose)
CToolbarWrapper - wrapper class for the toolbar buttons
(OnButton1Click, SetEnabled, SetVisible, ...)

Now I decided to use ribbons for 2007+ versions of outlook.
Unfortunately I had to break my OO design here...

My CAddin class newly implements IRibbonExtensibility.
GetCustomUI gets fired and returns XML for the
"Microsoft.Outlook.Mail.Read" Inspector window.

So far so good. I had to implement the OnRibbonButtonClick events
inside my CAddin (don't know how to do this inside CInspectorWrapper)
- this is a pain as it breaks my OO concept, but it works. I simply
cast the RibbonControl->GetContext() to Inspector type. If someone
knew how to do it inside the CInspectorWrapper then please advise - I
can post source code extracts if necessary.

But I don't know how to set the state of the ribbon buttons (enabled/
disabled) inside CInspector::OnActivate. The state of these buttons
can differ in every CInspectorWrapper instance - is there a special
event callback I need to implement or can I do it somehow using my
IRibbonUI pointer that I got from OnLoad handler?
Back to top
Login to vote
tnemec78

External


Since: May 21, 2009
Posts: 2



(Msg. 2) Posted: Thu May 21, 2009 8:46 am
Post subject: Re: Using Ribbon in Inspector window [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I think I might have figured it out already ... The only think I am
really not happy about is the fact that all of the ribbon stuff gets
handled inside my CAddin class. It should really be the job of the
individual CInspectorWrappers. Is it possible to do it that way? Right
now I seem to have quite a lot of unnecessary nearly duplicate code
around in separate classes (once for toolbars and the other time for
ribbons) This could one day be a debugger's nightmare ...
Back to top
Login to vote
Ken Slovak - [MVP - Outlo

External


Since: Oct 17, 2003
Posts: 2977



(Msg. 3) Posted: Thu May 21, 2009 2:59 pm
Post subject: Re: Using Ribbon in Inspector window [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The requirement from MS is that the interface handling and callbacks for the
ribbon must be in the same class as the class that implements the
IDTExtensibility interface. So OO design or not that's what you have to do.

What I do is implement a RibbonClicker() method in the Inspector wrapper
class. I call that method in the wrapper class to handle anything that is
specific to that Inspector, such as the states of toggle controls. In the
ribbon callback I identify which Inspector matches the Inspector in the
wrapper class and then I know which wrapper class to call to. Luckily
Outlook 2007 Inspectors can be compared directly using an equality test (==
or for VB using the Is operator), so finding the correct wrapper class is
easy.

I pass in any needed arguments from the ribbon callbacks to my
RibbonClicker() methods, so anything they need in the way of information is
available to them.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


<tnemec78.TakeThisOut@googlemail.com> wrote in message
news:22b35ffd-2c3e-4277-98fe-26a09a9747aa@n8g2000vbb.googlegroups.com...
>I think I might have figured it out already ... The only think I am
> really not happy about is the fact that all of the ribbon stuff gets
> handled inside my CAddin class. It should really be the job of the
> individual CInspectorWrappers. Is it possible to do it that way? Right
> now I seem to have quite a lot of unnecessary nearly duplicate code
> around in separate classes (once for toolbars and the other time for
> ribbons) This could one day be a debugger's nightmare ...
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> Program Add-Ins All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET |
  • IT Support