From: Neil B on
I'm developing an app in C++ using VS.net. I've created a CDialog derived
class called CDlgMemo. I've added a CEdit control variable to the CDlgMemo
class called m_memo. In OnInitDialog() I initialize m_memo using the
SetWindowText( ) method. When I execute this I get an ASSERT (see below)
indicating that the CEdit control does not have a CWnd handle. This is very
straight forward stuff I've done many times before. Any Ideas what's going
on????

void CWnd::SetWindowText(LPCTSTR lpszString)
{
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));

if (m_pCtrlSite == NULL)
::SetWindowText(m_hWnd, lpszString);
else
m_pCtrlSite->SetWindowText(lpszString);
}


*************** This is the code to initailize the dialog box ***********
BOOL CDlgMemo::OnInitDialog()
{
m_memo.SetWindowText("Now is the time");
CDialog::OnInitDialog();
return TRUE;
}

************** This is the code to create the dialog box **********
CDlgMemo dlg(GetParentFrame());

if (dlg.DoModal()==IDOK)
{
dlg.m_memos.GetWindowText(memo);
}