.idl 中的 coclass 导入接口在其他地方定义?

发布于 2024-07-30 10:27:45 字数 60 浏览 1 评论 0原文

我有一个 IDL 文件,它定义了一些接口,后跟一个组件类。 我可以让这个类导入这个类中没有定义的接口吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千秋岁 2024-08-06 10:27:46

是的。 您需要使用import指令加载外部接口的.idl,或者使用importlib加载类型库。 像这样:

import "otherlibrary.idl";

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

或者这样:

library MyLibrary
{
  importlib "otherlibrary.tlb";

  coclass MyClass
  {
    interface OtherInterface;
  };
};

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;
  };
};
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文