I am trying to add a text box to my form (down the road I wanted to pass data entered from this box to the Document for storage), but I am having trouble getting the text box to work.
Bellow is the code that I have tried. Why is my text box not appearing, and how do I properly get a text box to appear in my view.
void CMy861a4VasilkovskiyView::OnDraw(CDC* pDC)
{
CMy861a4VasilkovskiyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
const CString str("Hello");
pDC->TextOut(0, 0, str);
CEdit m_edit;
CRect rect(20,20,10,10);// (85, 110, 180, 210);
m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP |
ES_AUTOHSCROLL | WS_BORDER, rect, this, ES_LEFT);
// m_edit.SetFocus();
// TODO: add draw code for native data here
}
I can see a couple of problems :