RE: WTL dialogs in MFC application
Does m_Second have a PreTranslateMessage() member function that returns the
result of IsDialogMessage? This is needed for non-modal dialogs to hook
them into the app's message loop.
From: wtl@...
[mailto:wtl@...] On Behalf Of sagymz
Sent: Sunday, February 20, 2011 9:21 AM
To: wtl@...
Subject: [wtl] WTL dialogs in MFC application
Hi,
I have a MFC application project. I've added a new dialog to the project
and, using WTL wizard, added the header and the source files
(automatically generated). Then I created another dialog in the same
way.
To the first dialog I have added a CSplitterWindow member, and in the
OnInitDialog I have written the following:
CRect rect;GetClientRect(&rect);m_ctlSplitter1.Create(m_hWnd, rect,
NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
WS_CLIPCHILDREN);m_Second.Create(m_ctlSplitter1);m_ctlSplitter1.SetSplit\
terPanes(m_Second, ::GetDlgItem(m_hWnd, IDCANCEL),
false);m_ctlSplitter1.SetSplitterPos( rect.right/2 );
Where m_Second is the second dialog that I have mentioned before.
What I see after running it is that the second dialog is not presenting
the controls that it has on it. When running DoModal() on the second
dialog when it is not in the splitter, the dialog is shown fine, but
when it is inside the splitter, something is wrong.
Do you have any idea what might have gone wrong?
Thanks.
(Continue reading)