nsCOMPtr<nsIScriptGlobalObject> globalObj( aWin );
nsCOMPtr<nsIScriptGlobalObject> globalObj( do_QueryInterface(aWin) );
nsMsgAppCore::SetWindow(nsIDOMWindow* aWin){  nsAutoString  webShellName("browser.webwindow");  mWindow = aWin;  NS_ADDREF(aWin);  /* rhp - Needed to access the webshell to drive message display */  printf("nsMsgAppCore::SetWindow(): Getting the webShell of interest...\n");  nsCOMPtr<nsIScriptGlobalObject> globalObj( aWin );  if (!globalObj)   {    return NS_ERROR_FAILURE;  }  nsIWebShell *webShell = nsnull;  nsIWebShell *rootWebShell = nsnull;  globalObj->GetWebShell(&webShell);  if (nsnull == webShell)   {    return NS_ERROR_FAILURE;  }  webShell->GetRootWebShell(rootWebShell);  if (nsnull != rootWebShell)   {    rootWebShell->FindChildWithName(webShellName, mWebShell);#ifdef NS_DEBUG    if (nsnull != mWebShell)        printf("nsMsgAppCore::SetWindow(): Got the webShell %s.\n", webShellName.ToNewCString());    else        printf("nsMsgAppCore::SetWindow(): Failed to find webshell %s.\n", webShellName.ToNewCString());#endif    NS_RELEASE(rootWebShell);  }  NS_RELEASE(webShell);	return NS_OK;}