Using COMPtr
git-svn-id: svn://10.0.0.236/trunk@54047 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
719918611c
commit
540481040b
@ -24,6 +24,7 @@
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIRegistry.h"
|
||||
#include "nsIEnumerator.h"
|
||||
#include "prmem.h"
|
||||
@ -61,10 +62,8 @@ int main( int argc, char *argv[] ) {
|
||||
}
|
||||
|
||||
// Get the component manager
|
||||
nsIComponentManager *compMgr = NULL;
|
||||
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
|
||||
static NS_DEFINE_IID(kComponentManagerIID, NS_ICOMPONENTMANAGER_IID);
|
||||
rv = servMgr->GetService(kComponentManagerCID, kComponentManagerIID, (nsISupports **)&compMgr);
|
||||
nsCOMPtr<nsIComponentManager> compMgr = do_GetService(kComponentManagerCID, &rv);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
// Cant get component manager
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user