nsIFactory 编辑

xpcom/components/nsIFactory.idlScriptable This interface is a class factory that allows for the creation of nsISupports derived classes without specifying a concrete class type. Inherits from: nsISupports Last changed in Gecko 0.9.5

Method overview

void createInstance(in nsISupports aOuter, in nsIIDRef iid, [retval, iid_is(iid)] out nsQIResult result);
void lockFactory(in PRBool lock);

Methods

createInstance()

Creates an instance of the class associated with this factory. Unlike getService, this returns a new instance each time it is called. (See also nsIComponentManager.createInstance.)

void createInstance(
  in nsISupports aOuter,
  in nsIIDRef iid,
  [retval, iid_is(iid)] out nsQIResult result
);
Parameters
aOuter
Pointer to a component that wishes to be aggregated in the resulting instance. This can be nsnull if no aggregation is requested.
iid
The IID of the interface being requested in the component which is being currently created.
result
Pointer to the newly created instance, if successful.
Exceptions thrown
NS_ERROR_NO_INTERFACE
Indicates that the requested interface is not supported.
NS_ERROR_NO_AGGREGATION
Indicates that aggregation is not supported.

lockFactory()

This method provides the client a way to keep the component in memory until it is finished with it.

Gecko 1.7 note As of Gecko 1.7, this method is unused. Most implementations do nothing interesting with this method. It exists primarily for binary compatibility with Microsoft COM's IClassFactory interface.
void lockFactory(
  in PRBool lock
);
Parameters
lock
true to lock the factory, and false to unlock the factory.

Remarks

On WIN32 systems, nsIFactory is ABI-compatible with Microsoft COM's IClassFactory interface.

This interface was frozen for Gecko 0.9.5. See bug 99144 for details. From Gecko 2.0 interfaces are no longer frozen.

See also

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

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

发布评论

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

词条统计

浏览:93 次

字数:3928

最后编辑:7年前

编辑次数:0 次

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