Made it handle CIDs of the form {fe04c8e6-501e-11d3-a527-0060b0fc04b7}.
git-svn-id: svn://10.0.0.236/trunk@49216 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
5cc319a403
commit
4ed1f8c772
@ -29,20 +29,30 @@ void main(int argc, char* argv[])
|
||||
|
||||
// try loading a component and releasing it to see if it leaks
|
||||
if (argc > 1 && argv[1] != nsnull) {
|
||||
char* cidStr = argv[1];
|
||||
nsISupports* obj = nsnull;
|
||||
rv = nsComponentManager::CreateInstance(argv[1], nsnull,
|
||||
nsCOMTypeInfo<nsISupports>::GetIID(),
|
||||
(void**)&obj);
|
||||
if (cidStr[0] == '{') {
|
||||
nsCID cid;
|
||||
cid.Parse(cidStr);
|
||||
rv = nsComponentManager::CreateInstance(cid, nsnull,
|
||||
nsCOMTypeInfo<nsISupports>::GetIID(),
|
||||
(void**)&obj);
|
||||
}
|
||||
else {
|
||||
// progID case:
|
||||
rv = nsComponentManager::CreateInstance(cidStr, nsnull,
|
||||
nsCOMTypeInfo<nsISupports>::GetIID(),
|
||||
(void**)&obj);
|
||||
}
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
printf("Successfully created %s\n", argv[1]);
|
||||
printf("Successfully created %s\n", cidStr);
|
||||
NS_RELEASE(obj);
|
||||
}
|
||||
else {
|
||||
printf("Failed to create %s (%x)\n", argv[1], rv);
|
||||
printf("Failed to create %s (%x)\n", cidStr, rv);
|
||||
}
|
||||
}
|
||||
|
||||
rv = NS_ShutdownXPCOM(servMgr);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");
|
||||
NS_RELEASE(servMgr);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user