Good god, I want to split window on the right side of the MFC single document (using the CSplitterWnd implementation) put a CFormView view, and then Create a CPropertySheet object, performs CPropertySheet in CFormView OnCreate function the Create function is always wrong,
Int CRightView: : OnCreate (LPCREATESTRUCT LPCREATESTRUCT)
{
If (CFormView: : OnCreate (lpCreateStruct)==1)
return -1;
M_sheet=new CPropertySheet (_T (" Simple PropertySheet "));
ASSERT (m_sheet);
M_devInfo=new CDevInfo;
M_sheet - & gt; The AddPage (m_devInfo);
M_sheet - & gt; Create (this, WS_CHILD | WS_VISIBLE, WS_EX_CONTROLPARENT);
CRect rc;
GetClientRect (rc);
M_sheet - & gt; MoveWindow (rc);
return 0;
}
In the execution with tracking CPropertySheet the Create function after PropertySheet (& amp; An error occurred when m_psh)
//hook the window creation process
AfxHookWindowCreate (this);
HWND HWND=(HWND) PropertySheet (& amp; M_psh);
//final track to return: : an error occurred when CallWindowProc function, the processing of the message is WM_INITDIALOG (from uMsg value),
LRESULT CWnd: : DefWindowProc (UINT nMsg, WPARAM WPARAM, LPARAM LPARAM)
{
If (m_pfnSuper!=NULL)
Return: : CallWindowProc (m_pfnSuper m_hWnd, nMsg, wParam, lParam);
WNDPROC pfnWndProc;
If ((pfnWndProc=* GetSuperWndProcAddr ())==NULL)
Return: : DefWindowProc (m_hWnd, nMsg wParam, lParam);
The else
Return: : CallWindowProc (pfnWndProc m_hWnd, nMsg, wParam, lParam);
}
The same code, if it's not split window, no problem, please grant instruction,
CodePudding user response:
M_sheet=new CPropertySheet (_T (" Simple PropertySheet "));
ASSERT (m_sheet);
M_sheet - & gt; Create (this, WS_CHILD | WS_VISIBLE, WS_EX_CONTROLPARENT);
M_devInfo=new CDevInfo;
m_devInfo. Create... !!!!!!!!!!!!!! M_sheet - & gt; The AddPage (m_devInfo);
CodePudding user response:
reference 1st floor schlafenhamster response: m_sheet=new CPropertySheet (_T (" Simple PropertySheet ")); ASSERT (m_sheet); M_sheet - & gt; Create (this, WS_CHILD | WS_VISIBLE, WS_EX_CONTROLPARENT); M_devInfo=new CDevInfo; m_devInfo. Create... !!!!!!!!!!!!!! M_sheet - & gt; The AddPage (m_devInfo); Hello, didn't quite understand your meaning, it is said m_sheet - & gt; Create (... This statement is wrong? I've tried m_sheet - & gt; Create (this, WS_CHILD_WS_VISIBLE) writes, is the same error, Still say to create sheet, add page? CodePudding user response:
See red M_devInfo. Create... !!!!!!!!!!!!!! To Create plus CodePudding user response:
The reference 3 floor schlafenhamster response: see red M_devInfo. Create... !!!!!!!!!!!!!! To Create plus Still the same error, CodePudding user response:
Windows create the object points step 2 1 construct an object definition (or new) 2 the Create this object CodePudding user response:
This code is no problem in not intersected CFormView, just because on the split window, just had this problem, CodePudding user response:
CFormView dialog box is how to deal with the Derived a CFormView (view) line not line? CodePudding user response:
The right of the view from CFormView derived, increased the properties page and pointer members of the dialog: The class CRightView: public CFormView { DECLARE_DYNCREATE (CRightView) Protected: CRightView ();//used by dynamically create protected constructor Virtual ~ CRightView (); Public: Virtual void ontouch * pDC (CDC);//rewritten to draw the view # ifdef _DEBUG Virtual void AssertValid () const; # # ifndef _WIN32_WCE Virtual void Dump (CDumpContext& Dc) const; # endif # endif Protected: CPropertySheet * m_sheet; CDevInfo * m_devInfo; . }; CodePudding user response:
Put the OnInitialUpdate () M_sheet=new CPropertySheet (_T (" Simple PropertySheet ")); ASSERT (m_sheet); M_sheet - & gt; Create (this, WS_CHILD | WS_VISIBLE, WS_EX_CONTROLPARENT); M_devInfo=new CDevInfo; M_devInfo - & gt; The Create... M_sheet - & gt; The AddPage (m_devInfo); CodePudding user response:
references 9 f schlafenhamster response: put OnInitialUpdate () M_sheet=new CPropertySheet (_T (" Simple PropertySheet ")); ASSERT (m_sheet); M_sheet - & gt; Create (this, WS_CHILD | WS_VISIBLE, WS_EX_CONTROLPARENT); M_devInfo=new CDevInfo; M_devInfo - & gt; The Create... M_sheet - & gt; The AddPage (m_devInfo); Thank you for your enthusiastic, Tried, no good, CodePudding user response:
You have the CFormView dialog resource? CodePudding user response:
No problem on vc6 Void CView2: : the OnInitialUpdate () { CFormView: : OnInitialUpdate (); //TODO: Add your specialized code here and/or call the base class M_sheet=new CPropertySheet (_T (" Simple PropertySheet ")); //1 st the add page! M_devInfo=new CDevInfo; M_sheet - & gt; The AddPage (m_devInfo); // M_sheet - & gt; Create (this, WS_CHILD | WS_VISIBLE, WS_EX_CONTROLPARENT); CRect rc; nullnullnullnullnullnullnull