} else if (mClassID.Equals(kCCalendarUserCID)) { inst = (nsISupports *)new nsCalendarUser(aOuter);
nsresult nsCoreFactory::CreateInstance(nsISupports *aOuter,                                        const nsIID &aIID,                                        void **aResult)  {    if (aResult == NULL) {      return NS_ERROR_NULL_POINTER;    }    *aResult = NULL;      nsISupports *inst = nsnull;  if (mClassID.Equals(kCLayerCID)) {    inst = (nsISupports *)new nsLayer(aOuter);  }   if (inst == NULL) {      return NS_ERROR_OUT_OF_MEMORY;    }    nsresult res = inst->QueryInterface(aIID, aResult);  if (res != NS_OK) {      // We didn't get the right interface, so clean up      delete inst;    }    return res;  }  