I have a CSplitterWnd that loads to dialog resources into it. One dialog contains a CTreeCtrl only, and the other contains various other controls.
Currently I have the dialog with only the tree control attached to accelerators, in which case I have overridden PreTranslateMessage to attach command handlers to tab/shift+tab presses on the tree control.
At this point, I get the parent window (which has member variables for each pane in the splitter) and reference the variable for the right pane which has a public function that is to set focus to one of it's controls.
The code path works, as TRACE0 messages are being output as expected. However, if I try to work with any of the controls in the right panes dialog window, I'm getting an assertion.
The assertion occurs as a result of
CEdit* pWnd = (CEdit*)GetDlgItem( IDC_ESN );
being called. And the assertion is thrown from winocc.cpp at line 92:
CWnd* CWnd::GetDlgItem(int nID) const
{
ASSERT:IsWindow(m_hWnd)); // <-- ASSERTION
if (m_pCtrlCont == NULL)
return CWnd::FromHandle:....
....
}
So I see that m_hWnd isn't a window, but I'm not sure why. Am I to assume that m_hWnd is actually the HWND of the dialog?
If you can assist me with passing control focus from one dialog window to another, that'd be great.
Currently I have the dialog with only the tree control attached to accelerators, in which case I have overridden PreTranslateMessage to attach command handlers to tab/shift+tab presses on the tree control.
At this point, I get the parent window (which has member variables for each pane in the splitter) and reference the variable for the right pane which has a public function that is to set focus to one of it's controls.
The code path works, as TRACE0 messages are being output as expected. However, if I try to work with any of the controls in the right panes dialog window, I'm getting an assertion.
The assertion occurs as a result of
CEdit* pWnd = (CEdit*)GetDlgItem( IDC_ESN );
being called. And the assertion is thrown from winocc.cpp at line 92:
CWnd* CWnd::GetDlgItem(int nID) const
{
ASSERT:IsWindow(m_hWnd)); // <-- ASSERTION
if (m_pCtrlCont == NULL)
return CWnd::FromHandle:....
....
}
So I see that m_hWnd isn't a window, but I'm not sure why. Am I to assume that m_hWnd is actually the HWND of the dialog?
If you can assist me with passing control focus from one dialog window to another, that'd be great.