Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 54977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:18:18+00:00 2026-05-10T17:18:18+00:00

I have the following interface which I’m trying to make COM-visible. When I try

  • 0

I have the following interface which I’m trying to make COM-visible. When I try to generate the type-library it doesn’t like the fact that my implementation class derives from a generic-class.

Is it possible to use a generic class as a COM implementation class? (I know I could write a non-generic wrapper and export that to COM, but this adds another layer that I’d rather do without.)

[ComVisible(true)] public interface IMyClass {    ... }  [ComVisible(true), ComDefaultInterface(typeof(IMyClass))] [ClassInterface(ClassInterfaceType.None)] public class MyClass : BaseClass<IMyClass>, IMyClass {    ... }  

Error message:

Warning: Type library exporter encountered a type that derives  from a generic class and is not marked as  [ClassInterface(ClassInterfaceType.None)]. Class interfaces cannot be exposed for such types. Consider marking the type with  [ClassInterface(ClassInterfaceType.None)]  and exposing an explicit interface as the default interface to  COM using the ComDefaultInterface attribute.
  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:18:19+00:00Added an answer on May 10, 2026 at 5:18 pm

    Generic types and types that derive from a generic type cannot be exported. Set ComVisible(false) on your MyClass type. You’ll need to either create a non-generic class implementation or use the interface only.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an interface which is used like the following: if (SUCCEEDED(pInterface->GetSize(&size)) { wchar_t
I have the following interface defined to expose a .NET class to COM: [InterfaceType(ComInterfaceType.InterfaceIsDual)]
I have an .NET (4.0) interface which is implemented with a ServicedComponent COM+ class:
I have created an interface which I am inheriting from another (COM) interface: public
Am trying to create a tabbed interface in which the tabs can be visible
I have an NSDocument which has the following structure: @interface MyDocument : NSDocument {
I have something like following: public interface A { .... } public abstract class
I have the following interface CatalogVersionService which exposes some services. As well I have
I have the following code, which passes interface into a function which expects a
I have a class which implements the following interface: IUser { string UserName {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.