CSplitterWnd::GetPane asserts with CFormView pane
-
I have a working static splitter frame and need to retrieve pane based on CFormView. I am getting assertion in GetPane MFC (4.0 / VC 6.0) function , and only on this type of splitter pane. Plain CView works fine. I did search on similar problems and it looks like the CFormView is the problem. Any suggestion how to fix this? Please no “ upgrade to xxxx”, not an option. CWnd* CSplitterWnd::GetPane(int row, int col) const { ASSERT_VALID(this); CWnd* pView = GetDlgItem(IdFromRowCol(row, col)); ASSERT(pView != NULL); // panes can be a CWnd, but are usually CViews return pView; } Your help is as allways appreciated. Cheers Vaclav
-
I have a working static splitter frame and need to retrieve pane based on CFormView. I am getting assertion in GetPane MFC (4.0 / VC 6.0) function , and only on this type of splitter pane. Plain CView works fine. I did search on similar problems and it looks like the CFormView is the problem. Any suggestion how to fix this? Please no “ upgrade to xxxx”, not an option. CWnd* CSplitterWnd::GetPane(int row, int col) const { ASSERT_VALID(this); CWnd* pView = GetDlgItem(IdFromRowCol(row, col)); ASSERT(pView != NULL); // panes can be a CWnd, but are usually CViews return pView; } Your help is as allways appreciated. Cheers Vaclav
Which asset?
Steve
-
I have a working static splitter frame and need to retrieve pane based on CFormView. I am getting assertion in GetPane MFC (4.0 / VC 6.0) function , and only on this type of splitter pane. Plain CView works fine. I did search on similar problems and it looks like the CFormView is the problem. Any suggestion how to fix this? Please no “ upgrade to xxxx”, not an option. CWnd* CSplitterWnd::GetPane(int row, int col) const { ASSERT_VALID(this); CWnd* pView = GetDlgItem(IdFromRowCol(row, col)); ASSERT(pView != NULL); // panes can be a CWnd, but are usually CViews return pView; } Your help is as allways appreciated. Cheers Vaclav
Good Lord, Man, it's only 4 lines of code, 2 of them are ASSERTs. If you have the code, use the debugger and step into the function and see why it's blowing up. There are only 2 possibilities in that code, either the current object is not instantiated as a window (ASSERT_VALID) or the arguments you passed (row, column) do not represent a valid view (bad "pane coordinates") This should be easy enough to debug, once you know what it's complaining about, you'll know what you did wrong.