*aFactory = NULL;
*aFactory = nsnull;
NSGetFactory(nsISupports* aServMgr,             const nsCID &aClass,             const char *aClassName,             const char *aProgID,             nsIFactory **aFactory){    if (aFactory == NULL)    {        return NS_ERROR_NULL_POINTER;    }    *aFactory = NULL;    nsISupports *inst;        if (aClass.Equals(kProxyObjectManagerCID) )        inst = new nsProxyEventFactory();    else        return NS_ERROR_ILLEGAL_VALUE;    if (inst == NULL)        return NS_ERROR_OUT_OF_MEMORY;    nsresult res = inst->QueryInterface(nsIFactory::GetIID(), (void**) aFactory);    if (NS_FAILED(res))     {           delete inst;    }    return res;}