nsIWidget*	ppWidget; ppBaseWindow->GetMainWidget(&ppWidget);
nsCOMPtr<nsIWidget> ppWidget; ppBaseWindow->GetMainWidget(getter_AddRefs(ppWidget));
nsUrlWidget::SetURLToHiddenControl( char const *aURL, nsIDOMWindow *parent ){	nsresult rv = NS_OK;	HWND	hEdit=NULL; // Handle to the hidden editbox control.	HWND	hMainFrame=NULL;  // Handle to main frame window where our							//editbox is attached.    static const LONG editControlID = 12345;    nsCOMPtr<nsIScriptGlobalObject> ppScriptGlobalObj( do_QueryInterface(parent) );    if (!ppScriptGlobalObj)    {        return NS_ERROR_FAILURE;    }    nsCOMPtr<nsIDocShell> ppDocShell;    ppScriptGlobalObj->GetDocShell(getter_AddRefs(ppDocShell));    if (!ppDocShell)    {        return NS_ERROR_FAILURE;    }    nsCOMPtr<nsIBaseWindow> ppBaseWindow;    ppDocShell->QueryInterface(NS_GET_IID(nsIBaseWindow), (void **)&ppBaseWindow);    if (ppBaseWindow != NULL)    {        nsIWidget*	ppWidget;        ppBaseWindow->GetMainWidget(&ppWidget);        hMainFrame = (HWND)ppWidget->GetNativeData(NS_NATIVE_WIDGET);    }	if (!hMainFrame)	{		return NS_ERROR_FAILURE;	}    // See if edit control has been created already.    hEdit = GetDlgItem( hMainFrame, 12345 );    if ( !hEdit ) {        ULONG visibility = 0;        // Set this to WS_VISIBLE to debug.        //visibility = WS_VISIBLE;        hEdit = ::CreateWindow("Edit",                "",                WS_CHILD | WS_BORDER | visibility,                CW_USEDEFAULT,                CW_USEDEFAULT,                200,                15,                hMainFrame,                (HMENU)editControlID,                NULL,                NULL);    }	// OK.  If we have an editbox created, and a url, post it.	if ((aURL != NULL) && (hEdit != NULL))	{        #ifdef DEBUG_URLWIDGET        printf( "nsUrlWidget; window=0x%08X, url=[%s]\n", (int)hEdit, aURL );        #endif		::SendMessage(hEdit, WM_SETTEXT, (WPARAM)0, (LPARAM)aURL);	}    return rv;}