nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); NS_ASSERTION(NS_SUCCEEDED(rv), "NS_InitXPCOM failed");
int main(int argc, char **argv){	// Set up the toolbox and (if DEBUG) the console	InitializeMacToolbox();	// Install an a Quit AppleEvent handler.	OSErr err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,									NewAEEventHandlerProc(handleQuitApplication), 0, false);	NS_ASSERTION((err==noErr), "AEInstallEventHandler failed");	// Start up XPCOM? 	nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);	NS_ASSERTION(NS_SUCCEEDED(rv), "NS_InitXPCOM failed");	gTheApp = new nsNativeViewerApp();	if (gTheApp != nsnull) {		NS_ADDREF(gTheApp);		if (gTheApp->Initialize(argc, argv) == NS_OK)			gTheApp->Run();		NS_RELEASE(gTheApp);	}	// Shutdown XPCOM?	rv = NS_ShutdownXPCOM(nsnull);	NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");	return 0;}