Home > Software engineering >  Override OnCreateClient function after the operation does not work
Override OnCreateClient function after the operation does not work

Time:11-15

Write their own OnCreateClient function, had meant to be divided into three window, can change after the operation, code and operation result is as follows,
Don't know why wrong, hope leaders can help solve,

CodePudding user response:

BOOL CDlgSplitDlg: : OnInitDialog ()
{
//
M_pMyFrame=new CFrameWnd;
//or dialog "# 32770"/* */
M_pMyFrame - & gt; Create (AfxRegisterWndClass (0), "", WS_CHILD, rc, this);
//Initialize a context for the view.
CCreateContext cc.
Cc. M_pNewViewClass=RUNTIME_CLASS (CMyView);
Cc. M_pCurrentFrame=m_pMyFrame;
Cc. M_pCurrentDoc=NULL;
Cc. M_pNewDocTemplate=NULL;
Cc. M_pLastView=NULL;
//Get the rectangle of the custom window. The custom window
//is just a big a button that is not visible and is disabled.
//It 's a was catnip to not use coordinates directly.
//create the splitter with the frame as the parent
# ifdef _DEBUG
AfxTraceEnabled=FALSE;
# endif
# ifdef DYN
M_Splitter. Create (m_pMyFrame, 2, 2, CSize (50, 50), & amp; Cc, WS_CHILD | WS_VISIBLE | SPLS_DYNAMIC_SPLIT);
M_Splitter. MoveWindow (0, 0, rc Width (), rc, Height ());
M_Splitter. SplitRow (Hei);
M_Splitter. SplitColumn (Wid);
# the else
M_Splitter. CreateStatic (m_pMyFrame, 2, 2);//
//create views
M_Splitter. CreateView (0, 0, RUNTIME_CLASS (CMyView), CSize (Wid, Hei), & amp; Cc);
M_Splitter. CreateView (0, 1, RUNTIME_CLASS (CMyView), CSize (Wid, Hei), & amp; Cc);
M_Splitter. CreateView (1, 0, RUNTIME_CLASS (CMyView), CSize (Wid, Hei), & amp; Cc);
M_Splitter. CreateView (1, 1, RUNTIME_CLASS (CMyView), CSize (Wid, Hei), & amp; Cc);
M_Splitter. MoveWindow (0, 0, rc Width (), rc, Height ());
# endif
# ifdef _DEBUG
AfxTraceEnabled=TRUE;
# endif
M_pMyFrame - & gt; ShowWindow (SW_SHOW);
M_Splitter. ShowWindow (SW_SHOW);
//
((CMyView *) m_Splitter GetPane (0, 0)) - & gt; OnInitialUpdate ();
((CMyView *) m_Splitter GetPane (0, 1)) - & gt; OnInitialUpdate ();
((CMyView *) m_Splitter GetPane (1, 0)) - & gt; OnInitialUpdate ();
((CMyView *) m_Splitter GetPane (1, 1)) - & gt; OnInitialUpdate ();
//
//SetTimer (1100, 00, 0);
Return TRUE;//return TRUE unless you set the focus to a control
}
So there should be:
1 m_pMyFrame=new CFrameWnd;
2 class CMySplitterWnd: public CSplitterWnd
3 class CMyView: public CEditView

CodePudding user response:

https://download.csdn.net/download/schlafenhamster/6233893
"Segmentation dialog. Zip"

CodePudding user response:

CDialog won't call OnCreateClient, put in OnInitDialog processing

  • Related