RE: About Designing a GUI
I can use splittter in SDI application wtih this code and it can split:
class CMainFrame : public CFrameWnd
{
....
protected:
CSplitterWnd m_wndSplitter;
....
};
// SAMPLES\CH03\splitter
// MainFrm.cpp : implementation of the CMainFrame class
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs,
CCreateContext* pContext)
{
CSize minWindow(10, 10);
// These variables must both be 1 or 2 for dynamic splitters.
int nRows = 2, nColumns = 1;
return m_wndSplitter.Create(this, nRows, nColumns,
minWindow, pContext);
//
}
But this doent work with MDI application.
I can't divide MDI client window. I tried this:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
CSize minWindow(10, 10);
// These variables must both be 1 or 2 for dynamic splitters.
int nRows = 2, nColumns = 1;
m_wndSplitter.Create(this, nRows, nColumns,
minWindow, pContext);
return CMDIFrameWnd::OnCreateClient(lpcs, pContext);
}
But it gives run time error about ASSERT(pContext != NULL);
What is wrong with this code?
I am looking for your answers.
Thanks...