IRibbonExtensibility and Exchange Client Addin

D

devansh.mittal

Hi All Experts,

I have an exchange client extension and I am tring to get the Ribbon
work for Office Outlook 2007.

My problem is that, Outlook 2007 does not query for
IID_IRibbonExtensibility in the main addin class which implements
IExchExt. It queries for IID_IExchExt which leads me to believe I am
missing something completely. Any help is most appreciated.

I am implementing IRibbonExtensibility in the same class where
IExchExt is implemented. In the QueryInterface() function it is not
querying for IID_IRibbonExtensibility.

Kindly help.

Thanks in advance,
Devansh
 
D

Devansh

Thanks Dmitry.
I saw your reply on the location you mentioned. I have done exactly
what you said.
My Addin class implements IExchExt, IExchExtSessionEvents,
IExchExtMessageEvents, Office::IRibbonExtensibility
In the QueryInterface() function I am trying to match riid with the
IID of IRibbonExtensibility in the following say

else if (riid == __uuidof(Office::IRibbonExtensibility))
{
/* some code */
}

Unfortunately the above condition is never being satisfied.
Kindly help. I do not know where I am making the mistake.

Thanks,
Devansh
 
S

SvenC

Hi Devansh,
My Addin class implements IExchExt, IExchExtSessionEvents,

You are not developing an Addin but an Exchange Client Extension.

Those are different things. Only if you implement an Office
COM Addin Outlook will QI for IRibbonExtensibility.

Use MSDN or the search engine of your choice to get information
on how to write a COM addin.
 
D

Devansh

Thanks SvenC.
According to what Dmitry has said in one of his posts that we can add
IRibbonExtensibility support in our Exchange Client Extension, so I
did that.
The statement made by Dmitry is as follows, kindly let me know in case
I have wrongly interpreted it,
"Outlook will only QI for IRibbonExtensibility if your class is a COM
add-in.
Nothing however prevents you from implementing a COM add-in in the
same dll
or even the same class as your ECE."

Thanks,
Devansh
 
D

Devansh

Thanks SvenC.
According to what Dmitry has said in one of his posts that we can add
IRibbonExtensibility support in our Exchange Client Extension, so I
did that.
The statement made by Dmitry is as follows, kindly let me know in case
I have wrongly interpreted it,
"Outlook will only QI for IRibbonExtensibility if your class is a COM
add-in.
Nothing however prevents you from implementing a COM add-in in the
same dll
or even the same class as your ECE."

Thanks,
Devansh
 
S

SvenC

Hi Devansh,
According to what Dmitry has said in one of his posts that we can add
IRibbonExtensibility support in our Exchange Client Extension, so I
did that.
The statement made by Dmitry is as follows, kindly let me know in case
I have wrongly interpreted it,
"Outlook will only QI for IRibbonExtensibility if your class is a COM
add-in.
Nothing however prevents you from implementing a COM add-in in the
same dll
or even the same class as your ECE."

But you also need to implement the COM Addin stuff in your dll and
register the COM Addin registry keys.
If you just interface implementations the Office apps will not know that
you also implement a COM Addin.
Your extension class which implements the IExchxxx interfaces will
never be QI'ed for COM addin interfaces.
 
D

Devansh

Thanks SvenC.
I did implement COM Addin stuff in my dll.
But what do you mean by "register the COM Addin registry keys".
and how do you do that?
I must mention that my DLL in which ECE and IRibbonExtensibility are
implemented is registered. Do you mean to say that I should register
IRibbonExtensibility interface separately?
Is it something related to regsrv32? If yes how?
Kindly let me know in a bit detail.
 
S

SvenC

Hi Devansh,
I did implement COM Addin stuff in my dll.
But what do you mean by "register the COM Addin registry keys".
and how do you do that?
I must mention that my DLL in which ECE and IRibbonExtensibility are
implemented is registered. Do you mean to say that I should register
IRibbonExtensibility interface separately?
Is it something related to regsrv32? If yes how?
Kindly let me know in a bit detail.

Please use your favorite web search engine, you find lots of explanations.
Here is one:

http://www.codeproject.com/KB/COM/outlookaddin.aspx

Look at the section registering an addin.
 
D

Dmitry Streblechenko

*If* your ECE is also a COM add-in.
I was just pointing out that you do not have to create a separate dll or
even a separate class to create a COM add-in.
But you still need to create a COM add-in somehow and register it
appropriately with Outlook.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
D

Devansh

*If* your ECE is also a COM add-in.
I was just pointing out that you do not have to create a separate dll or
even a separate class to create a COM add-in.
But you still need to create a COM add-in somehow and register it
appropriately with Outlook.

Thanks Dmitry and SvenC.
One more question.
I have a class which implements _IDTExtensibility2,
IRibbonExtensibility, IExchExt, IExchExtSessionEvents,
IExchExtMessageEvents, ICallbackInterface

The problem which I am facing is, IDTExtensibility2,
IRibbonExtensibility, ICallbackInterface are dual interfaces which are
automatically being implemented by the VS IDE with the help of
IDispatchImpl<T> templated class. On the other hand IExchExt,
IExchExtSessionEvents, IExchExtMessageEvents interfaces are not COM
interfaces. I need to have a common implementation of IDispatch and
IUnknown for all the interfaces. When I tried this it says
QueryInterfaces(), AddRef(), ReleaseRef() are already declared and it
uses some default implementation given by IDE.

I may be wrong in the approach I am following. The purpose if to
implement all the interfaces in the same class. Kindly help me in
doing so.

Thanks,
Devansh
 
D

Dmitry Streblechenko

I do not use VC++, so I cannot give you any advise on anaythign wizard
generated.
IExchExt etc *are* COM interfaces, but they are derived from IUnknown, while
IDTExtensibility2 interface is derived from IDispatch.
You do not need to implement any IDispatch related methods (GetIDsOfNames,
Invoke, etc). The IUnknown methods (AddRef, QueryInterface, Release) are
still applicable, so you only need IDTExtensibility2 specific methods.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Devansh said:
*If* your ECE is also a COM add-in.
I was just pointing out that you do not have to create a separate dll or
even a separate class to create a COM add-in.
But you still need to create a COM add-in somehow and register it
appropriately with Outlook.

--
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thanks SvenC.
According to what Dmitry has said in one of his posts that we can add
IRibbonExtensibility support in our Exchange Client Extension, so I
did that.
The statement made by Dmitry is as follows, kindly let me know in case
I have wrongly interpreted it,
"Outlook will only QI for IRibbonExtensibility if your class is a COM
add-in.
Nothing however prevents you from implementing a COM add-in in the
same dll
or even the same class as your ECE."

Hi Devansh,
My Addin class implements IExchExt, IExchExtSessionEvents,
You are not developing an Addin but an Exchange Client Extension.
Those are different things. Only if you implement an Office
COM Addin Outlook will QI for IRibbonExtensibility.
Use MSDN or the search engine of your choice to get information
on how to write a COM addin.

Thanks Dmitry and SvenC.
One more question.
I have a class which implements _IDTExtensibility2,
IRibbonExtensibility, IExchExt, IExchExtSessionEvents,
IExchExtMessageEvents, ICallbackInterface

The problem which I am facing is, IDTExtensibility2,
IRibbonExtensibility, ICallbackInterface are dual interfaces which are
automatically being implemented by the VS IDE with the help of
IDispatchImpl<T> templated class. On the other hand IExchExt,
IExchExtSessionEvents, IExchExtMessageEvents interfaces are not COM
interfaces. I need to have a common implementation of IDispatch and
IUnknown for all the interfaces. When I tried this it says
QueryInterfaces(), AddRef(), ReleaseRef() are already declared and it
uses some default implementation given by IDE.

I may be wrong in the approach I am following. The purpose if to
implement all the interfaces in the same class. Kindly help me in
doing so.

Thanks,
Devansh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top