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.
XPCOM Startup/Shutdown
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_NewLocalFile
to create annsIFile
object to supply as the bin directory path in this call.Syntax:
extern "C" NS_COM nsresult NS_InitXPCOM2( nsIServiceManager* *result,nsIFile* binDirectory, nsIDirectoryServiceProvider* appFileLocationProvider)Parameters:
binDirectory:
The directory containing the component registry and runtime libraries. You can usensnull
to 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 usensnull
for the default behaviour.
nsresult
See also: see
NS_NewLocalFile
,nsILocalFile
, andnsIDirectoryServiceProvider
.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 byNS_InitXPCOM2
. This will release the service manager. You may passnull
.
nsresult:
Syntax:
extern "C" NS_COM nsresult NS_GetServiceManager( nsIServiceManager** result)Parameters:
nsresult:
Accesses the Component Manager.
Syntax:
NS_COM nsresult NS_GetComponentManager( nsIComponentManager** result)Parameters:
nsresult:
Accesses the Component Registration Manager.
Syntax:
NS_COM nsresult NS_GetComponentRegistrar( nsIComponentRegistrar** result)Parameters:
nsresult:
Syntax:
NS_COM nsresult NS_GetMemoryManager(nsIMemory** result)Parameters:
nsresult:
Written by:Ellen Evans | Comments, questions, complaints?
Bug 143387 |