if ( NS_SUCCEEDED( windowInfo->mRDFID->EqualsString( resourceString, &isMatch) ) && isMatch ) { nsCOMPtr <nsIDOMWindow> DOMWindow; if( NS_SUCCEEDED ( GetDOMWindow( windowInfo->mWindow, DOMWindow  ) ) ) { *outWindow = DOMWindow; result = NS_OK; } break; } }
nsAutoString temp( inResource ); char* resourceString = ToNewCString(temp); nsWindowInfo *info, *listEnd;
NS_IMETHODIMP  nsWindowMediator::GetWindowForResource( const PRUnichar* inResource, nsIDOMWindow** outWindow ){	if ( outWindow == NULL )		return NS_ERROR_INVALID_ARG;	*outWindow = NULL;	PRInt32 count = mWindowList.Count();	// Find the window	nsresult result = NS_ERROR_FAILURE;	nsString temp( inResource );	char* resourceString = temp.ToNewCString();	for ( int32 i = 0; i< count; i++ )	{			nsWindowInfo* windowInfo = (nsWindowInfo*) mWindowList[i];		PRBool isMatch = PR_FALSE;		if ( NS_SUCCEEDED( windowInfo->mRDFID->EqualsString( resourceString, &isMatch) ) && isMatch ) 		{			nsCOMPtr <nsIDOMWindow> DOMWindow;			if( NS_SUCCEEDED ( GetDOMWindow( windowInfo->mWindow, DOMWindow  ) ) )			{					*outWindow = DOMWindow;				result = NS_OK;			}			break;		}	} 	delete resourceString;	return result;}