You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.
These C++ functions serve to initialize and terminate XPCOM. (In an embedding situation, this is usually taken care of by embedding initialization.) Also included are a number of global functions that provide access to the main XPCOM components.
Note: These are C++ functions only, and are therefore not scriptable.
Initializes XPCOM. This function must be called before using XPCOM. The one exception is that you may call
NS_NewLocalFileto create an
nsIFileobject to supply as the bin directory path in this call.
Syntax:extern "C" NS_COM nsresult NS_InitXPCOM2( nsIServiceManager* *result,nsIFile* binDirectory, nsIDirectoryServiceProvider* appFileLocationProvider)
binDirectory:The directory containing the component registry and runtime libraries. You can use
nsnullto use the working directory.
appFileLocProvider:The object to be used by Gecko that specifies to Gecko where to find profiles, the component registry preferences and so on. You can use
nsnullfor the default behaviour.
See also: see
Shuts down XPCOM. This function must be called when you are finished using XPCOM.
Syntax:extern "C" NS_COM nsresult NS_ShutdownXPCOM( nsIServiceManager* servMgr)
servMgr:The service manager which was returned by
NS_InitXPCOM2. This will release the service manager. You may pass
Syntax:extern "C" NS_COM nsresult NS_GetServiceManager( nsIServiceManager** result)
Accesses the Component Manager.
Syntax:NS_COM nsresult NS_GetComponentManager( nsIComponentManager** result)
Accesses the Component Registration Manager.
Syntax:NS_COM nsresult NS_GetComponentRegistrar( nsIComponentRegistrar** result)
Syntax:NS_COM nsresult NS_GetMemoryManager(nsIMemory** result)
| Written by:Ellen Evans | Comments, questions, complaints?