M
Marcin
I have to write a small program in Visual C++ using MFC. Problem is that I
have no idea how to create and show windows i MFC when the parent is a
dialog window. At the beginning I decided to choose "dialog based project"
becouse it seemed to be simmillar to progrmming in C++ Builder but it was
only the illussion.
What I want to do:
I want to put a window (not a control fom toolbox but regular blank
window) on my dialog to do some drawing on it.
What I don't know:
How to Create the window?
Where to create the window? In what class, module ?
I tried to write like this (I placed this code into dialog constructor )....
(...)
CmapaDlg::CmapaDlg(CWnd* pParent /*=NULL*/)
: CDialog(CmapaDlg::IDD, pParent)
{
CString classname = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW);
CWnd okno;
okno.Create((LPCTSTR)classname, "moje_okno", WS_CHILD | WS_VISIBLE |
WS_BORDER, CRect(1,1,20,20), this, NULL, NULL);
okno.ShowWindow(SW_SHOW);
}
.... and it doesn't work
have no idea how to create and show windows i MFC when the parent is a
dialog window. At the beginning I decided to choose "dialog based project"
becouse it seemed to be simmillar to progrmming in C++ Builder but it was
only the illussion.
What I want to do:
I want to put a window (not a control fom toolbox but regular blank
window) on my dialog to do some drawing on it.
What I don't know:
How to Create the window?
Where to create the window? In what class, module ?
I tried to write like this (I placed this code into dialog constructor )....
(...)
CmapaDlg::CmapaDlg(CWnd* pParent /*=NULL*/)
: CDialog(CmapaDlg::IDD, pParent)
{
CString classname = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW);
CWnd okno;
okno.Create((LPCTSTR)classname, "moje_okno", WS_CHILD | WS_VISIBLE |
WS_BORDER, CRect(1,1,20,20), this, NULL, NULL);
okno.ShowWindow(SW_SHOW);
}
.... and it doesn't work