Bonjour
J’ai une application que je veux diviser en 4 panels puis diviser le panel embat à droit en 2. (J’utilise CSplitterWnd)
L’application fonctionne en release mais en debug j’ai une assertion au moment de la création du 2 eme CSplitterWnd.
Quelqu'un pourrait-il me dire ci mes splitter son correctement mis en place et ci oui d’où pourrait venir le problème?
l'erreur viens de cette function:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 // simple "wiper" splitter BOOL CSplitterWnd::CreateStatic(CWnd* pParentWnd, int nRows, int nCols, DWORD dwStyle, UINT nID) { ASSERT(pParentWnd != NULL); ASSERT(nRows >= 1 && nRows <= 16); ASSERT(nCols >= 1 && nCols <= 16); ASSERT(nCols > 1 || nRows > 1); // 1x1 is not permitted ASSERT(dwStyle & WS_CHILD); mon erreur >>> ASSERT(!(dwStyle & SPLS_DYNAMIC_SPLIT)); // can't have dynamic split ASSERT(m_nRows == 0 && m_nCols == 0); // none yet m_nRows = m_nMaxRows = nRows; m_nCols = m_nMaxCols = nCols; // create with zero minimum pane size if (!CreateCommon(pParentWnd, CSize(0, 0), dwStyle, nID)) return FALSE; // all panes must be created with explicit calls to CreateView return TRUE; }
Mon code:
Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 // creat spliters. m_wndSplitterVert.CreateStatic(this, 2, 2, WS_CHILD | WS_VISIBLE , AFX_IDW_PANE_FIRST ); m_wndSplitterHorz.CreateStatic(&m_wndSplitterVert, 2, 1, WS_CHILD|SPLS_DYNAMIC_SPLIT|WS_VISIBLE|SB_VERT, m_wndSplitterVert.IdFromRowCol(1, 0)); // creat views m_wndSplitterVert.CreateView(0, 0, RUNTIME_CLASS(CListDialog), CSize(263, 100), pContext); m_wndSplitterVert.CreateView(0, 1, RUNTIME_CLASS(CModelDialog), CSize(100, 100), pContext); m_wndSplitterVert.CreateView(1, 1, RUNTIME_CLASS(CModelView), CSize(100,100), pContext); m_wndSplitterHorz.CreateView(0, 0, RUNTIME_CLASS(CListView), CSize(100, 400), pContext); m_wndSplitterHorz.CreateView(1, 0, RUNTIME_CLASS(CTipsBox), CSize(100, 100), pContext);
Partager