1

Topic: Problem with layout of pages on CTabCtrl in another CTabCtrl

On a dialog box there is component TAB_CTRL1 of type CTabCtrl on which some pages - pPage1 are allocated, pPage2, pOrbitDefinition, pPage5, pPage6 (offsprings of class CDialog). And on one of these pages (pOrbitDefinition) other component TAB_CTRL of type CTabCtrl on which two pages pPage3, pPage4 (also offsprings of class CDialog are placed) is allocated. Also there was a problem with layout of these two pages pPage3 and pPage4 on component TAB_CTRL allocated on page pOrbitDefinition - the debugger fights at line in which function Create for pPage3.\In what the reason of it is caused? How to rectify an error? The code: BOOL CFlightToMoonDlg:: OnInitDialog () {CPage1 *pPage1; CPage2 *pPage2; CPage3* pPage3; CPage4* pPage4; CPage5 *pPage5; CPage6 *pPage6; COrbitDefinition *pOrbitDefinition; CDialog:: OnInitDialog ();//TCITEM TabItem; TabItem.mask = TCIF_TEXT; TabItem.pszText = L "Initial WELL"; m_IDC_TAB1.InsertItem (0,&TabItem); TabItem.pszText = L "driving Model"; m_IDC_TAB1.InsertItem (1,&TabItem); TabItem.pszText = L "orbit Determination"; m_IDC_TAB1.InsertItem (2,&TabItem); TabItem.pszText = L "Calculation of ephemerises"; m_IDC_TAB1.InsertItem (3,&TabItem); TabItem.pszText = L "the approach Forecast"; m_IDC_TAB1.InsertItem (4,&TabItem); CSize csize; csize. SetSize (100,28); m_IDC_TAB1.SetItemSize (csize); LOGFONT lf; CFont *pfont; memset (&lf,0,sizeof (lf)); lf.lfHeight = 16; lf.lfWidth = 8; lf.lfWeight = FW_NORMAL;//lf.lfWeight = FW_BOLD; lf.lfCharSet = ANSI_CHARSET; lf.lfOutPrecision = OUT_DEFAULT_PRECIS; lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; lf.lfQuality = PROOF_QUALITY; lf.lfPitchAndFamily = VARIABLE_PITCH | FF_ROMAN; wcscpy (lf.lfFaceName, L "MS Sans Serif"); pfont = new CFont (); pfont-> CreateFontIndirectW (&lf); m_IDC_TAB1.SetFont (pfont);//pPage1 = new CPage1 (this); pPage2 = new CPage2 (this); pPage5 = new CPage5 (this); pPage6 = new CPage6 (this); pOrbitDefinition = new COrbitDefinition (this);//TabItem.mask = TCIF_PARAM; TabItem.lParam = (LPARAM) pPage2; m_IDC_TAB1.SetItem (0,&TabItem); VERIFY (pPage2-> Create (CPage2::IDD,&m_IDC_TAB1)); pPage2-> SetWindowPos (NULL, 10,30,0,0, SWP_NOSIZE|SWP_NOZORDER); pPage2-> ShowWindow (SW_SHOW);//TabItem.mask = TCIF_PARAM; TabItem.lParam = (LPARAM) pPage1; m_IDC_TAB1.SetItem (1,&TabItem); VERIFY (pPage1-> Create (CPage1::IDD,&m_IDC_TAB1)); pPage1-> SetWindowPos (NULL, 10,30,0,0, SWP_NOSIZE|SWP_NOZORDER); pPage1-> ShowWindow (SW_HIDE);//TabItem.mask = TCIF_PARAM; TabItem.lParam = (LPARAM) pOrbitDefinition; m_IDC_TAB1.SetItem (2,&TabItem); VERIFY (pOrbitDefinition-> Create (COrbitDefinition::IDD,&m_IDC_TAB1)); pOrbitDefinition-> SetWindowPos (NULL, 10,30,0,0, SWP_NOSIZE|SWP_NOZORDER); pPage3 = new CPage3 (this); pPage4 = new CPage4 (this); pOrbitDefinition-> pPage3 = pPage3; pOrbitDefinition-> pPage4 = pPage4; TCITEM TabItem2; TabItem2.mask = TCIF_TEXT; TabItem2.pszText = L "Measurements"; pOrbitDefinition-> m_IDC_TAB1.InsertItem (0,&TabItem2); TabItem2.pszText = L "Boundary value problem"; pOrbitDefinition-> m_IDC_TAB1.InsertItem (1,&TabItem2); CSize csize2; csize2.SetSize (100,28); pOrbitDefinition-> m_IDC_TAB1.SetItemSize (csize2); LOGFONT lf2; CFont *pfont2; memset (&lf2,0,sizeof (lf2)); lf2.lfHeight = 16; lf2.lfWidth = 8; lf2.lfWeight = FW_NORMAL; lf2.lfCharSet = ANSI_CHARSET; lf2.lfOutPrecision = OUT_DEFAULT_PRECIS; lf2.lfClipPrecision = CLIP_DEFAULT_PRECIS; lf2.lfQuality = PROOF_QUALITY; lf2.lfPitchAndFamily = VARIABLE_PITCH | FF_ROMAN; wcscpy (lf2.lfFaceName, L "MS Sans Serif"); pfont2 = new CFont (); pfont2-> CreateFontIndirectW (&lf2); pOrbitDefinition-> m_IDC_TAB1.SetFont (pfont2);//pOrbitDefinition-> ShowWindow (SW_HIDE);//TabItem.mask = TCIF_PARAM; TabItem.lParam = (LPARAM) pPage5; m_IDC_TAB1.SetItem (3,&TabItem); VERIFY (pPage5-> Create (CPage5::IDD,&m_IDC_TAB1)); pPage5-> SetWindowPos (NULL, 10,30,0,0, SWP_NOSIZE|SWP_NOZORDER); pPage5-> ShowWindow (SW_HIDE);//TabItem.mask = TCIF_PARAM; TabItem.lParam = (LPARAM) pPage6; m_IDC_TAB1.SetItem (4,&TabItem); VERIFY (pPage6-> Create (CPage6::IDD,&m_IDC_TAB1)); pPage6-> SetWindowPos (NULL, 10,30,0,0, SWP_NOSIZE|SWP_NOZORDER); pPage6-> ShowWindow (SW_HIDE);//TabItem2.mask = TCIF_PARAM; TabItem.lParam = (LPARAM) pPage3; m_IDC_TAB1.SetItem (0,&TabItem2); VERIFY (pOrbitDefinition-> pPage3-> Create (CPage3::IDD,& (pOrbitDefinition-> m_IDC_TAB1)));//the program pOrbitDefinition-> pPage3-> SetWindowPos (NULL, 10,30,0,0, SWP_NOSIZE|SWP_NOZORDER) here fights; pOrbitDefinition-> pPage3-> ShowWindow (SW_SHOW);//TabItem2.mask = TCIF_PARAM; TabItem2.lParam = (LPARAM) pPage4; m_IDC_TAB1.SetItem (1,&TabItem2); VERIFY (pOrbitDefinition-> pPage4-> Create (CPage4::IDD,& (pOrbitDefinition-> m_IDC_TAB1))); pOrbitDefinition-> pPage4-> SetWindowPos (NULL, 10,30,0,0, SWP_NOSIZE|SWP_NOZORDER); pOrbitDefinition-> pPage4-> ShowWindow (SW_HIDE); return TRUE;}

2

Re: Problem with layout of pages on CTabCtrl in another CTabCtrl

Hello, RussianFellow, you wrote: RF> the Code: RF> RF> TabItem.pszText = L "the approach Forecast"; RF> off: Sincerely I hope, what your professional creativity never quits in  and does not get in  RF> And there was a problem with layout of these two pages pPage3 and pPage4 on component TAB_CTRL allocated on page pOrbitDefinition - the debugger fights at line in which function Create for pPage3.\RF> In what the reason of it is caused? How to rectify an error? Deliver  there where "fights" and look at the reason, for this purpose will enough push . The button in debugger dialogue

3

Re: Problem with layout of pages on CTabCtrl in another CTabCtrl

RF>> In what the reason of it? How to rectify an error? _> deliver  there where "fights" and look at the reason, for this purpose will enough push . The button in debugger dialogue What button to push?

4

Re: Problem with layout of pages on CTabCtrl in another CTabCtrl

Hello, RussianFellow, you wrote: RF>>> In what the reason of it? How to rectify an error? _>> deliver  there where "fights" and look at the reason, for this purpose will enough push . The button in dialogue of debugger RF> What button to push? The button can be called Retry/Break//, precisely I do not remember,  (a picture from the Internet): at pushing it you should get to a debugger with an open source code where there was a call of this dialogue (in MFC normally it is what-thread call ASSERT, e.g. ASSERT (hWnd! = NULL)). Look on the stack where has been caused ASSERT, on what condition it worked, it can helps to find the reason.

5

Re: Problem with layout of pages on CTabCtrl in another CTabCtrl

I transferred the insertion code  pPage3 and pPage4 on page pOrbitDefinition in function COrbitDefinition:: OnInitDialog: BOOL COrbitDefinition:: OnInitDialog () {CDialog:: OnInitDialog (); TCITEM TabItem2; TabItem2.mask = TCIF_TEXT; TabItem2.pszText = L "Measurements"; m_IDC_TAB1.InsertItem (0,&TabItem2); TabItem2.pszText = L "Boundary value problem"; m_IDC_TAB1.InsertItem (1,&TabItem2); pPage3 = new CPage3 (&m_IDC_TAB1); pPage4 = new CPage4 (&m_IDC_TAB1); CSize csize2; csize2.SetSize (100,28); m_IDC_TAB1.SetItemSize (csize2); LOGFONT lf2; CFont *pfont2; memset (&lf2,0,sizeof (lf2)); lf2.lfHeight = 16; lf2.lfWidth = 8; lf2.lfWeight = FW_NORMAL; lf2.lfCharSet = ANSI_CHARSET; lf2.lfOutPrecision = OUT_DEFAULT_PRECIS; lf2.lfClipPrecision = CLIP_DEFAULT_PRECIS; lf2.lfQuality = PROOF_QUALITY; lf2.lfPitchAndFamily = VARIABLE_PITCH | FF_ROMAN; wcscpy (lf2.lfFaceName, L "MS Sans Serif"); pfont2 = new CFont (); pfont2-> CreateFontIndirectW (&lf2); m_IDC_TAB1.SetFont (pfont2);//TabItem2.mask = TCIF_PARAM; TabItem2.lParam = (LPARAM) pPage3; m_IDC_TAB1.SetItem (0,&TabItem2); ASSERT (pPage3-> Create (CPage3::IDD,&m_IDC_TAB1));//the program pPage3-> SetWindowPos (NULL, 10,30,0,0, SWP_NOSIZE|SWP_NOZORDER) here fights; pPage3-> ShowWindow (SW_SHOW);//TabItem2.mask = TCIF_PARAM; TabItem2.lParam = (LPARAM) pPage4; m_IDC_TAB1.SetItem (1,&TabItem2); ASSERT (pPage4-> Create (CPage4::IDD,&m_IDC_TAB1)); pPage4-> SetWindowPos (NULL, 10,30,0,0, SWP_NOSIZE|SWP_NOZORDER); pPage4-> ShowWindow (SW_HIDE); m_IDC_TAB1.SetCurSel (0); return TRUE;} And at line ASSERT (pPage3-> Create (CPage3::IDD,&m_IDC_TAB1)); the program fights - jumps out message Debug Assertion Failed! Program: C:\Windows\system32\mfc110ud.dll File: f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgdata.cpp Line: 40 That it means? How to rectify this error?

6

Re: Problem with layout of pages on CTabCtrl in another CTabCtrl

Hello, pilgrim _, you wrote: _> Hello, RussianFellow, you wrote: RF>> the Code: RF>> RF>> TabItem.pszText = L "the approach Forecast"; RF>> _> off: Sincerely I hope that your professional creativity never quits in  and does not get in  Selected above - me a little  I Will remind that ALWAYS it is recommended - to carry out a line in the table of string based resources. We did it on MFC  in 2002. However, companion RussianFellow, registers a line directly in code Hint: If tomorrow creativity RussianFellow has to be delivered, for example in Democratic People's Republic of Korea, - dancings with tambourines are provided

7

Re: Problem with layout of pages on CTabCtrl in another CTabCtrl

The problem is solved. In class CPage3 as DoDataExchange I removed calls of functions DDX_Control for those components of this class which I deleted earlier. And all at me normally earned.

8

Re: Problem with layout of pages on CTabCtrl in another CTabCtrl

Hello, AlexGin, you wrote: RF>>> RF>>> TabItem.pszText = L "the approach Forecast"; RF>>> AG> I Will remind that ALWAYS it is recommended - to carry out a line in the table of string based resources. We did it on MFC  in 2002. AG> however, companion RussianFellow, registers a line directly in code AG> Hint: If tomorrow creativity RussianFellow has to be delivered, for example in Democratic People's Republic of Korea, - dancings with tambourines are provided Well about what you speak, what lines/resources/kndr than is engaged in the HARDWARE I think never falls outside the limits the country, and here if at what-thread reading of a file the Author: RussianFellow Date: 27.03.17 (to pay attention to readable structure) what-thread garbage will be read, or castes with digit capacity loss can and to a head suddenly something to fall, that it would not be desirable ps: litter for  and HARDWARE arguing, anything personal

9

Re: Problem with layout of pages on CTabCtrl in another CTabCtrl

Hello, pilgrim _, you wrote: _> Hello, AlexGin, you wrote: RF>>>> RF>>>> TabItem.pszText = L "the approach Forecast"; RF>>>> By the way, whether is  the Hardware Th of the bed-sheets  disclosure  secrets?