Before that I use segmentation window class, will the client area divided into two parts, one part of established CMyFormView class, attribute form inside, this page is to add attributes to create function
Int CMyFormView: : OnCreate (LPCREATESTRUCT LPCREATESTRUCT)
{
If (CFormView: : OnCreate (lpCreateStruct)==1)
return -1;
//TODO: here to add your special creation code
CRect the rect.
GetWindowRect (& amp; The rect);
CRgn RGN.
M_propSheet=new CMyPropSheet (_T (" WXM "));
M_propSheet - & gt; The AddPage (& amp; M_prop1);
M_propSheet - & gt; The AddPage (& amp; M_prop2);
//p_propSheet - & gt; Create (this, DS_CONTEXTHELP | DS_SETFONT | WS_CHILD | WS_VISIBLE);
M_propSheet - & gt; Create (this, WS_CHILD | WS_VISIBLE, 0).
M_propSheet - & gt; ModifyStyleEx (0, WS_TABSTOP);
M_propSheet - & gt; ModifyStyle (0, WS_THICKFRAME | WS_SYSMENU);//
M_propSheet - & gt; SetWindowPos (NULL, 0, 0, the rect. Right - the rect. Left, the rect. The bottom - the rect. Top, SWP_NOACTIVATE);
CTabCtrl * m_tabctrl=m_propSheet - & gt; GetTabControl ();//
M_tabctrl - & gt; SetWindowPos (NULL, 0, 0, the rect. Right - the rect. Left, the rect. The bottom - the rect. Top, SWP_NOACTIVATE);//
return 0;
}
Below are parts of the document class program,
CMainFrame * pMain=(CMainFrame *) AfxGetApp () - & gt; M_pMainWnd;
CCenter_pickupView * pView=(CCenter_pickupView *) pMain - & gt; GetActiveView ();
PDoc CCenter_pickupDoc *=pView - & gt; GetDocument ();
Cstrings str1, str2 str3;
Str1. The Format (_T (" % 3 "f), theApp. Probe_coordinate. X);
Str2. The Format (_T (" % 3 "f), theApp. Probe_coordinate. Y);
Str3. The Format (_T (" % 3 "f), theApp. Probe_coordinate. Z);
CMyFormView * pFormView=(CMyFormView *) pMain - & gt; GetActiveView ();
while(! PFormView - & gt; IsKindOf (RUNTIME_CLASS (CMyFormView)))
{
CMyFormView * pFormView=(CMyFormView *) pMain - & gt; GetActiveView ();
}
PFormView - & gt; M_prop2. GetDlgItem (IDC_EDIT_PROBE_X1) - & gt; SetWindowText (str1);
PFormView - & gt; M_prop2. GetDlgItem (IDC_EDIT_PROBE_Y1) - & gt; SetWindowText (str2);
PFormView - & gt; M_prop2. GetDlgItem (IDC_EDIT_PROBE_Z1) - & gt; SetWindowText (str3);
Compile without a problem, but to run to the third last, will be an error Debug an Assertion Failed dialog box that,,,