130405. Makes the xpcom glue library usable. Updates XPCOM Samples. Adds requires lines to a few implict string/category consumers sr=alecf, sr=brendan@mozilla.org a=asa@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@175324 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -67,9 +67,15 @@ main(void)
|
||||
NS_ASSERTION(registrar, "Null nsIComponentRegistrar");
|
||||
registrar->AutoRegister(nsnull);
|
||||
|
||||
|
||||
nsCOMPtr<nsIComponentManager> manager = do_QueryInterface(registrar);
|
||||
NS_ASSERTION(registrar, "Null nsIComponentManager");
|
||||
|
||||
// Create an instance of our component
|
||||
nsCOMPtr<nsISample> mysample = do_CreateInstance(NS_SAMPLE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsISample> mysample;
|
||||
rv = manager->CreateInstanceByContractID(NS_SAMPLE_CONTRACTID,
|
||||
nsnull,
|
||||
NS_GET_IID(nsISample),
|
||||
getter_AddRefs(mysample));
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
printf("ERROR: Cannot create instance of component " NS_SAMPLE_CONTRACTID " [%x].\n"
|
||||
@@ -110,6 +116,7 @@ main(void)
|
||||
printf("Test FAILED.\n");
|
||||
return -4;
|
||||
}
|
||||
|
||||
rv = mysample->WriteValue("Final print :");
|
||||
printf("Test passed.\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user