inst = new nsListBox(aOuter);
nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,                                            const nsIID &aIID,                                            void **aResult)  {      if (aResult == NULL) {          return NS_ERROR_NULL_POINTER;      }      *aResult = NULL;        if (nsnull != aOuter && !aIID.Equals(kISupportsIID)) {        // aggregation with IID != nsISupports        return NS_ERROR_ILLEGAL_VALUE;    }    nsWindow *inst = nsnull;    if (aIID.Equals(kCWindow)) {        inst = new nsWindow(aOuter);    }    else if ( mClassID.Equals(kCCheckButtonCID)) {        inst = new nsCheckButton(aOuter);    }    else if ( mClassID.Equals(kCButtonCID)) {        inst = new nsButton(aOuter);    }    else if (mClassID.Equals(kCVertScrollbarCID)) {        inst = new nsScrollbar(aOuter, PR_TRUE);    }    else if (mClassID.Equals(kCHorzScrollbarCID)) {        inst = new nsScrollbar(aOuter, PR_FALSE);    }    else if (aIID.Equals(kIScrollbar)) {        inst = nsnull;        fprintf(stderr, "------ NOT CreatingkIScrollbar Scrollbar\n");    }    else if (mClassID.Equals(kCTextWidgetCID)) {        inst = new nsTextWidget(aOuter);    }    else if (mClassID.Equals(kCListBoxCID)) {        //inst = new nsListBox(aOuter);    }    else if (mClassID.Equals(kCFileWidgetCID)) {        inst = new nsFileWidget(aOuter);    }    else if (aIID.Equals(kIWidget)) {        inst = new nsWindow(aOuter);    }    else if (mClassID.Equals(kCChild)) {        inst = new ChildWindow(aOuter);    }    else if (aIID.Equals(kIAppShellIID)) {      nsIAppShell *appInst = (nsIAppShell*)new nsAppShell();      if (appInst == NULL) {            return NS_ERROR_OUT_OF_MEMORY;        }        nsresult res = appInst->QueryInterface(aIID, aResult);      if (res != NS_OK) {        delete appInst ;      }      return res;    }      if (inst == NULL) {          return NS_ERROR_OUT_OF_MEMORY;      }    nsresult res = inst->QueryObject(aIID, aResult);  if (res != NS_OK) {    delete inst ;  }  return res;    return NS_OK;  }  