nsIFactory 编辑
xpcom/components/nsIFactory.idl
Scriptable 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.5Method 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, andfalse
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论