Question

I have an IDL file that defines a few interfaces followed by a coclass. Can I make this class import interfaces that are not defined in this class?

Was it helpful?

Solution

Yes. You need to use the import directive to load the .idl for the external interfaces, or use importlib to load the type library. Something like this:

import "otherlibrary.idl";

library MyLibrary
{
  coclass MyClass
  {
    interface OtherInterface;
  };
};

Or this:

library MyLibrary
{
  importlib "otherlibrary.tlb";

  coclass MyClass
  {
    interface OtherInterface;
  };
};
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top