nsIInterfaceRequestor 编辑

xpcom/base/nsIInterfaceRequestor.idlScriptable This interface defines a generic interface for requesting interfaces that a given object might provide access to. Inherits from: nsISupports Last changed in Gecko 0.9.5

This is similar to nsISupports.QueryInterface(). The main difference is that interfaces returned are not required to provide a way back to the object implementing nsIInterfaceRequestor. The semantics of nsISupports.QueryInterface() dictate that given an interface A that you nsISupports.QueryInterface() on to get to interface B, you must be able to nsISupports.QueryInterface() on B to get back to A. nsIInterfaceRequestor, however, allows you to obtain an interface C from A that may (or most likely) will not have the ability to get back to A.

Method overview

void getInterface(in nsIIDRef uuid, [iid_is(uuid),retval] out nsQIResult result);

Methods

getInterface()

Retrieves the specified interface pointer.

void getInterface(
  in nsIIDRef uuid,
  [iid_is(uuid),retval] out nsQIResult result
);
Parameters
uuid
The IID of the interface being requested.
result
The interface pointer to be filled in if the interface is accessible.
Exceptions thrown
NS_ERROR_NO_INTERFACE
The requested interface is not available.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:65 次

字数:2773

最后编辑:7年前

编辑次数:0 次

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