nsISupports 编辑

xpcom/base/nsISupports.idlScriptable All XPCOM interfaces inherit this interface.   Last changed in Gecko 1.0

Method overview

nsrefcnt AddRef();Violates the XPCOM interface guidelines
void QueryInterface(in nsIIDRef uuid, [iid_is(uuid),retval] out nsQIResult result);
nsrefcnt Release();Violates the XPCOM interface guidelines

Methods

Violates the XPCOM interface guidelines

AddRef()

Notifies the object that an interface pointer has been duplicated.

nsrefcnt AddRef();
Parameters

None.

Return value

An integer value that is generally ignored.

QueryInterface()

The QueryInterface method provides runtime type discovery.

Note: The interface pointer, aResult, returned by QueryInterface must be released by a call to Release() when it is no longer needed. QueryInterface is a symmetric, transitive, and reflexive operator.

void QueryInterface(
  in nsIIDRef uuid,
  [iid_is(uuid),retval] out nsQIResult result
);
Parameters
uuid
The uuid of the requested interface
result
The resulting interface pointer.
Exceptions thrown
NS_ERROR_NO_INTERFACE
The requested interface is not available.
Violates the XPCOM interface guidelines

Release()

Notifies the object that an interface pointer has been destroyed and any resources the object held on behalf of the client can be released.

nsrefcnt Release();
Parameters

None.

Return value

An integer value that is generally ignored.

Remarks

The method descriptions above were taken from Essential COM by Don Box. The point of those descriptions is to highlight the fact that AddRef() and Release() do not necessarily correspond to incrementing and decrementing a counter, respectively, even though that is how they are usually implemented.

On Win32 systems, nsISupports is ABI-compatible with Microsoft COM's IUnknown interface.

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

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

发布评论

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

词条统计

浏览:111 次

字数:3755

最后编辑:7年前

编辑次数:0 次

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