Be_ginner
August 24th, 1999, 03:55 PM
I have a CFormView that I want to create my own CEdit control on. I have the following defined in my .h file for the view:
...
CEdit *m_Edit;
...
in my implementation code I have in OnInitialUpdate():
m_Edit = new CEdit;
if (m_Edit != NULL)
{
if (m_Edit->Create(WS_CHILD | WS_VISIBLE,
CRect(20, 20, 120, 120),
this,
IDC_MYEDIT) == NULL)
{
AfxMessageBox("Failed to create CEdit");
return;
}
m_Edit->ShowWindow(SW_SHOW);
}
The CEdit fails to display. I basically followed the example "Adding Controls by Hand", the only difference is that I am using a CFormView instead of a CDialog, and I am using a CEdit *m_Edit instead of a CEdit m_Edit.
Why does this not work?
Be_ginner
...
CEdit *m_Edit;
...
in my implementation code I have in OnInitialUpdate():
m_Edit = new CEdit;
if (m_Edit != NULL)
{
if (m_Edit->Create(WS_CHILD | WS_VISIBLE,
CRect(20, 20, 120, 120),
this,
IDC_MYEDIT) == NULL)
{
AfxMessageBox("Failed to create CEdit");
return;
}
m_Edit->ShowWindow(SW_SHOW);
}
The CEdit fails to display. I basically followed the example "Adding Controls by Hand", the only difference is that I am using a CFormView instead of a CDialog, and I am using a CEdit *m_Edit instead of a CEdit m_Edit.
Why does this not work?
Be_ginner