tags:

views:

250

answers:

1

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?

+3  A: 

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;
  };
};
1800 INFORMATION
The importlib is exactly what I needed. Thanks!
Zenox