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

  • Home
  • SEARCH
  • 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 8561493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:30:48+00:00 2026-06-11T16:30:48+00:00

I have an interface define in C#, for example: [ComVisible(true), Guid(E37EBA3C-FB2E-4D4A-8A90-F6FAA99E85C9)] public interface TestClass

  • 0

I have an interface define in C#, for example:

[ComVisible(true), Guid("E37EBA3C-FB2E-4D4A-8A90-F6FAA99E85C9")]
public interface TestClass
{
    public void test_function();
}

I want to include this in a library define in IDL. I tried to achieve this by generating a .tlb from C# interface and include it with importlib. However, I do not see this interface in my library when I compile my idl file, but I see all of the other interfaces that I defined in this library through importing their idl files.

import "AnotherClass.idl"
library COMMONPROGRAMS{
    importLib(stdole32.tlb)
    importLib(stdole2.tlb)
    importLib(TestClass.tlb)

    interface TestClass;
    interface AnotherClass;
}

In summary, I want to know:

  • Is it possible to include a C# interface in a IDL library?
  • If so, how can I do this?

All answers are welcome. Thank you in advance for any answers submitted.

  • 1 1 Answer
  • 0 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. Editorial Team
    Editorial Team
    2026-06-11T16:30:49+00:00Added an answer on June 11, 2026 at 4:30 pm

    When you import a TLB with importlib you don’t see the interfaces in the current TLB as they are not a part of that TLB. Those interfaces are already defined in TestClass type library, so they can’t have another definition in the CommonPrograms library.

    If you want to define the interface elsewhere but make it a part of your TLB, you need to import it with import TestClass.idl. One way to generate the IDL from TLB is to open the TLB in OLE/COM Object Viewer and choose File->Save As, then edit it. I suppose that this is not what you want, as most likely you want to have this procedure automated.

    However, with importlib you can still reference TestClass interface from CommonPrograms types, so this is usually not a big obstacle, but that obviously depends on your requirements.

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

Sidebar

Related Questions

I have defined the following Interface [ServiceContract] public interface IHealthProducts { [OperationContract()] ResponseClass OrderSelfSignedHealthCertificate();
I have an aidl file defined as follows: package com.erbedo.callalert; interface RemoteCallAlert { void
Is it possible to define an Interface with optional implementation methods? For example I
I have an interface declared in its own header MyInterface.h: class MyInterface{ public: virtual
What is the best/standard way to define a web service interface? For example, I
Suppose I have a class called Animal and an interface called AnimalTrainer. public interface
I have the following interfaces defined: public interface IAudit { DateTime DateCreated { get;
I have a composite component: <composite:interface> <composite:attribute name=actionMethod method-signature=java.lang.String action() required=true /> </composite:interface> <composite:implementation>
I have the interface defined as below and is implemented by a single class
I have an interface that defines the ability to persist an entity to a

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.