cannot instantiate abstract class - Compiler error.

  • Thread starter KarthikonIT via OfficeKB.com
  • Start date
K

KarthikonIT via OfficeKB.com

Hi,
I have created a plugin for Outlook, I want add ribbon controls to my
existing OUtlook plugin.
When I Implement "IRibbonExtensibility" Interface in the class that was
implemented "_IDTExtensibility2" Interface it throws
up the following error message


ATL::CComObject<Base>' : cannot instantiate abstract class
with
[
Base=CGrabExplorer
]
due to following members:
'HRESULT Office::IRibbonExtensibility::raw_GetCustomUI(BSTR,BSTR *)' :
is abstract


I have implemented "GetCustomUI" API and returning S_OK


How do i resolve this?

Thanks in Advance.
 
K

Ken Slovak - [MVP - Outlook]

GetCustomUI() returns a string value, specifically a BStr, not S_OK. Does
your declaration look something like this, given that my declaration is from
a C# project:

[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);

}
 
K

KarthikonIT via OfficeKB.com

Hi,

Thx for ur reply,
I ve created my plugin in C++,

STDMETHOD(GetCustomUI)(BSTR RibbonID, BSTR * RibbonXml)

This API will return XML content of the ribbon control in "RibbonXml"
parameter so the return value is not a string.

My sample works fine but when i implement this "IRibbonExtensibility"
interface in my existing Outlook plugin it throws

up the error

ATL::CComObject<Base>' : cannot instantiate abstract class
with
[
Base=CGrabExplorer
]
due to following members:
'HRESULT Office::IRibbonExtensibility::raw_GetCustomUI(BSTR,BSTR *)' :
is abstract"


I m implementing this interface in the class which already implmented
"_IDTExtensibility2"

I ve tried this multiple times but it throws up same error.

Thanks..






GetCustomUI() returns a string value, specifically a BStr, not S_OK. Does
your declaration look something like this, given that my declaration is from
a C# project:

[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);

}
Hi,
I have created a plugin for Outlook, I want add ribbon controls to my
[quoted text clipped - 18 lines]
Thanks in Advance.
 

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