how to put a window on dialog in MFC
From: Marcin (mati776_at_wp.pl)
Date: 08/10/04
- Next message: Mateusz Łoskot: "Re: OT: gcc speed"
- Previous message: christopher diggins: "Re: "C++ with Interfaces" (article in CUJ vol 22 no 9)"
- Next in thread: Victor Bazarov: "Re: how to put a window on dialog in MFC"
- Reply: Victor Bazarov: "Re: how to put a window on dialog in MFC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 10 Aug 2004 15:34:38 +0200
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
- Next message: Mateusz Łoskot: "Re: OT: gcc speed"
- Previous message: christopher diggins: "Re: "C++ with Interfaces" (article in CUJ vol 22 no 9)"
- Next in thread: Victor Bazarov: "Re: how to put a window on dialog in MFC"
- Reply: Victor Bazarov: "Re: how to put a window on dialog in MFC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|