Mark Zielinski
May 29th, 1999, 10:18 AM
I am trying to create some dynamic static controls within a dialog box. I have found one function that works but the other does not. I would like to use Create instead of CreateWindow. Create Window works, Create is not displaying the text.
Here is the example. Any help would be appreciated.
int CDynamicDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
// This works
CreateWindow("static", "Text from CreateWindow", WS_CHILD | WS_VISIBLE,
10,10,300,20, m_hWnd, (HMENU)11, 0, NULL);
// This does not work
CStatic m_Text;
m_Text.Create(_T("Text From Create"), WS_CHILD | WS_VISIBLE,
CRect(100,100,300,20), this, 12 );
return 0;
}
Here is the example. Any help would be appreciated.
int CDynamicDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
// This works
CreateWindow("static", "Text from CreateWindow", WS_CHILD | WS_VISIBLE,
10,10,300,20, m_hWnd, (HMENU)11, 0, NULL);
// This does not work
CStatic m_Text;
m_Text.Create(_T("Text From Create"), WS_CHILD | WS_VISIBLE,
CRect(100,100,300,20), this, 12 );
return 0;
}