I am trying to extend this to work in a three-pane split view, but having no
success.
The code below resides in the OnCreateClient fn of my Mainframe (SDI app).
The code executes ok except that the call to ::setwindowlong returns 0 and a
subsequent (not in the code) call to GetLastError gives 'Invalid menu
handle'. Menu???? OnCreateClient completes and then before the app mainframe
appears, MFC throws an assertion in the GetPane() fn of CSplitterWnd.
Evidently the pane which the dialog box is meant to be in doesn't exist.
I'm totally stuck on this so any help would be great.
Thanks.
Mainframe class has following data members:
CSplitterWnd m_wndSplitter;
CSplitterWnd m_wndSplitter2;
CDialog Dialog;
Mainframe::OnCreateClient:
...
// Top-level split: 1 row, 2 columns
m_wndSplitter.CreateStatic(this, 1, 2);
// Populate lefthand view with CView - in the app a map will go into this
pane
m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CView), CSize(0, 0), pContext);
// Populate righthand view with a second splitter pane: 2 rows, 1 column
BOOL boRes=m_wndSplitter2.CreateStatic(&m_wndSplitter,2,1,
WS_CHILD | WS_VISIBLE,
m_wndSplitter.IdFromRowCol(0,1));
// Populate bottom-right view with a dialog box, with dialog window type set
to child.
BOOL boResult=Dialog.Create(IDD_DIALOG,&m_wndSplitter2);
LONG id=::SetWindowLong(Dialog.m_hWnd,GWL_ID,
m_wndSplitter2.IdFromRowCol(0,0));
// Populate top-right view with a CView - in the app another map will go
into this pane
m_wndSplitter2.CreateView(1, 0, RUNTIME_CLASS(CView), CSize(0, 0),
pContext);
...
Johan Rosengren
Responsable Informatique
PACTA S.A.
Mark Jones <ma...@saturn-technologies.com.antispam (remove .antispam for
replying)> a écrit dans le message :
ixPz4.7780$7F3.1...@nnrp4.clara.net...