Hi Ken,
I hope you are doing well and preparing for Christmas.
- I've tried your code to put into .idl file of my code.
And derived my COM plug in class from IRibbonExtensibility. But it does
not work.
class ATL_NO_VTABLE OAddin :
public ISupportErrorInfo,
public CComObjectRootEx <CComSingleThreadModel>,
public CComCoClass <OAddin, &CLSID_OAddin>,
public IDispatchImpl <IOAddin, &IID_IOAddin, &LIBID_OALib>,
public IDispatchImpl <_IDTExtensibility2, &IID__IDTExtensibility2,
&LIBID_AddInDesignerObjects>,
public IDispatchImpl<IRibbonExtensibility, &IID_IRibbonExtensibility,
&LIBID_Office>,
- Then, I placed the mso.dll in my project directory and Implement the
interface (IRibbonExtensibility) from it.
Almost same code as above. But it again gives some errors. I am a bit
confused again. How to implement this interface in my existing class?
- I am also trying to do late binding using IUnkown and IDispatch
interface. But it is also getting failed.
m_spApp->QueryInterface (IID_IRibbonExtensibility, (void**)&pInterface);
Please suggest me which way I should go and which one has better scalablity.
_
"rakesh" <get.rakesh.sharma@gmail.com> wrote in message
news:OhopYI9fKHA.4528@TK2MSFTNGP06.phx.gbl...
> Thanks again Ken,
> I was out of station so today I've checked your reply.
> I'll try this then will update you what is the output,
>
> _
>
> " - " <kenslovak@mvps.org> wrote in message
> news:%234rGt3meKHA.4112@TK2MSFTNGP06.phx.gbl...
> > What you want to do is feasible. I don't do C++ addins, but here's how
> > I'd do it using C#. I'd set up one class that handles the extensibility
> > interface. I'd reference the Outlook 2000 object model. In my
> > extensibility class (or actually a partial instance of that class) I'd
> > have the ribbon declarations.
>
>> When I got OnConnection() I'd get the Outlook version. Based on that I'd
> > create user interface for Explorers and Inspectors using CommandBars
> > where appropriate, and just let the ribbon callbacks fire for that UI
> > where it was Outlook 2007 or 2010. For 2007 I'd create Explorer UI using
> > CommandBars, for 2010 it would just be ribbon UI for Explorers.
>
>> For the ribbon declarations I'd have something like this:
>
>> //internal namespace to facilitate "Office" alias
> > space RibbonInterop
>
>> {
>
>> namespace Office
>
>> {
>
>> #region Ribbon
>
>> [ComImport(), Guid("000C0395-0000-0000-C000-000000000046"),
> > TypeLibType((short)0X1040)]
>
>> public interface IRibbonControl
>
>> {
>
>> [DispId(1)]
>
>> string Id { [return: MarshalAs(UnmanagedType.BStr)]
>
>> [MethodImpl(MethodImplOptions.InternalCall,
>
>> MethodCodeType = MethodCodeType.Runtime), DispId(1)] get; }
>
>
>> [DispId(2)]
>
>> object Context { [return: MarshalAs(UnmanagedType.IDispatch)]
>
>> [MethodImpl(MethodImplOptions.InternalCall,
>
>> MethodCodeType = MethodCodeType.Runtime), DispId(2)] get; }
>
>
>> [DispId(3)]
>
>> string Tag { [return: MarshalAs(UnmanagedType.BStr)]
>
>> [MethodImpl(MethodImplOptions.InternalCall,
>
>> MethodCodeType = MethodCodeType.Runtime), DispId(3)] get; }
>
>> }
>
>> [ComImport(), Guid("000C0396-0000-0000-C000-000000000046"),
> > TypeLibType((short)0X1040)]
>
>> public interface IRibbonExtensibility
>
>> {
>
>> [return: MarshalAs(UnmanagedType.BStr)]
>
>> [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType =
> > MethodCodeType.Runtime), DispId(1)]
>
>> string GetCustomUI([In(), MarshalAs(UnmanagedType.BStr)] string
> > RibbonID);
>
>> }
>
>> [ComImport(), Guid("000C03A7-0000-0000-C000-000000000046"),
> > TypeLibType((short)0X1040)]
>
>> public interface IRibbonUI
>
>> {
>
>> // for both Office 2007 and 2010
>
>> [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType =
> > MethodCodeType.Runtime), DispId(1)]
>
>> void Invalidate();
>
>> [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType =
> > MethodCodeType.Runtime), DispId(2)]
>
>> void InvalidateControl([In(), MarshalAs(UnmanagedType.BStr)] string
> > ControlID);
>
>> // for Office 2010
>
>> [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType =
> > MethodCodeType.Runtime), DispId(3)]
>
>> void InvalidateControlMso([In(), MarshalAs(UnmanagedType.BStr)] string
> > ControlID);
>
>> [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType =
> > MethodCodeType.Runtime), DispId(4)]
>
>> void ActivateTab([In(), MarshalAs(UnmanagedType.BStr)] string ControlID);
>
>> [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType =
> > MethodCodeType.Runtime), DispId(5)]
>
>> void ActivateTabMso([In(), MarshalAs(UnmanagedType.BStr)] string
> > ControlID);
>
>> [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType =
> > MethodCodeType.Runtime), DispId(6)]
>
>> void ActivateTabQ([In(), MarshalAs(UnmanagedType.BStr)] string ControlID,
>
>> [In(), MarshalAs(UnmanagedType.BStr)] string Namespace);
>
>> }
>
>> #endregion
>
>> }
>
>> }
>
>
>> > >
> >
>
>
>
>
>
>
>> "rakesh" <get.rakesh.sharma@gmail.com> wrote in message
> > news:%23DbDRykeKHA.1592@TK2MSFTNGP06.phx.gbl...
> >> Thanks Ken,
> >
>>> I am using MS VC6 with ATL to build this COM plugin. Upto Outlook 2007,
> >> my plugin was looking great in Outlook's toolbar pane and in Outlook's
> >> menu.
> >> But in Outlook 2010 with ribbon technology, this toolbar looks very
> >> awkward. So I want to create a ribbon for my plugin in MS Outlook. And
> >> want to remove old toolbar from it.
> >
>>> To create ribbon, I came to know that Windows 7 sdk is needed and mostly
> >> MS VS 2005/2008 c++ is used to develop them.
> >> I've created a sample ribbon button in Outlook with the help of other
> >> articles. But now I am confused, about my previous code.
> >> How can I merge both in one DLL?
> >
>>> If one user has Outlook 2000 - 2007 and another has Outlook 2010, I want
> >> to support them using one DLL. Based on Outlook version I want to show
> >> the apropriate Toolbar to the user. Internal processing works fine for
> >> all versions. Difference is only in GUI.
> >> Is it feasible?
> >
>>> Suggest me...
> >
>>> _
> >>
> >
>