im making a simple "Input Dialog" that will return the value of an Edit Box back to the calling Dialog

Code:
	CInputDlg InputDlg(this);

	if(InputDlg.DoModal() == IDOK)
	{
		CString res= InputDlg.ReturnName();
	}
Code:
CString CInputDlg::ReturnName()
{
	//wchar_t test[260]={0};
	CString res;
	GetDlgItemText(IDC_Rename,res);
return res;
}
but application crashes on GetDlgItemText() with "Debug Assertion Failed"

any ideas why?
thanks