Click here to Skip to main content
15,903,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to create different Dialogs as Tabs in single window. Pin
B_U_A7-Feb-09 19:22
B_U_A7-Feb-09 19:22 
AnswerRe: How to create different Dialogs as Tabs in single window. Pin
«_Superman_»8-Feb-09 15:36
professional«_Superman_»8-Feb-09 15:36 
GeneralRe: How to create different Dialogs as Tabs in single window. Pin
B_U_A8-Feb-09 18:09
B_U_A8-Feb-09 18:09 
GeneralRe: How to create different Dialogs as Tabs in single window. Pin
«_Superman_»8-Feb-09 19:04
professional«_Superman_»8-Feb-09 19:04 
GeneralRe: How to create different Dialogs as Tabs in single window. Pin
B_U_A8-Feb-09 19:26
B_U_A8-Feb-09 19:26 
GeneralRe: How to create different Dialogs as Tabs in single window. Pin
«_Superman_»8-Feb-09 19:31
professional«_Superman_»8-Feb-09 19:31 
GeneralRe: How to create different Dialogs as Tabs in single window. Pin
hemlat8-Feb-09 20:50
hemlat8-Feb-09 20:50 
QuestionRe: How to create different Dialogs as Tabs in single window. [modified] Pin
B_U_A8-Feb-09 23:54
B_U_A8-Feb-09 23:54 
Thanks. Of course you were right and sure enough, I have found the appropriate InitInstance function.
I then did what you suggested and put the code in (instead of the .DoModal() of the main app window.
And thanks for pointing it out, as while studying this particular *.cpp file and the header file, I have straight away learnt something new about the main app and how it gets instanciated. So that was interesting and worth-while.

However, ...and sorry to be a pain... I am still not quite satisfied:
1) ...because Windows killed my program upon exiting it. It first displays the tabs perfectly fine and I can hop between the individual tabs and so on, but when closing it (via the OK or CANCEL button) it indeed closes the application, but then the WINDOWS OS comes with a message telling that it had to terminate the program, which could not be closed properly (you know, ..the old "Do you want to send a report to Microssoft" error dialog.

2) ...well and secondly, because that is still not quite the behaviour that I want from my little test application.
I try to summarize what I need:

i) When the program (dialog box-based) starts, the a main window with a handful controls appears.
ii) Beside some buttons and static text controls, one of the controls is a tab control which will later contain a whole range of tabs for different things (obviously, as this is what a tab control is for - to group different entities of parameters/data...). After start up the focus should be on the first tab (but I guess I can suss that out later)
iii) I want the tab control to display some dialogs, which I have previously designed with the resource editor. So they exist as individual dialogs - for this purpose I have derived classes from CPropertyPage and an instance of CPropertySheet:
CPropertySheet myPropertySheet;
CTestPage1 myPage1;
CTestPage2 myPage2;


--> In other words, I want one main window which contains a tab control that shows different content (depending which tab you select) and besides this tab control it will have other elements, too. I don't want the tab control to overlay the whole window (sitting on top). I want the individual dialogs (myPage1 and myPage2 to be just in the tab.

And I have seen some fancy workarounds in this great forum to achieve simialr things; some really interesting looking self-made classes, which I am also keen to study - but at a later stage of my "programming career". For now I want to make this work with MFC, ....and sure there must be a way. I have seen a lot of applications out there, that do exactly that.

I hope all this makes sense. Thanks for your help...

modified on Monday, February 9, 2009 6:12 AM

AnswerRe: How to create different Dialogs as Tabs in single window. Pin
«_Superman_»9-Feb-09 4:28
professional«_Superman_»9-Feb-09 4:28 
QuestionRe: How to create different Dialogs as Tabs in single window. [modified] Pin
B_U_A9-Feb-09 21:34
B_U_A9-Feb-09 21:34 
AnswerRe: How to create different Dialogs as Tabs in single window. Pin
«_Superman_»10-Feb-09 1:55
professional«_Superman_»10-Feb-09 1:55 
QuestionRe: How to create different Dialogs as Tabs in single window. Pin
B_U_A10-Feb-09 21:56
B_U_A10-Feb-09 21:56 
AnswerRe: How to create different Dialogs as Tabs in single window. Pin
«_Superman_»10-Feb-09 22:07
professional«_Superman_»10-Feb-09 22:07 
QuestionRe: How to create different Dialogs as Tabs in single window. Pin
B_U_A10-Feb-09 22:26
B_U_A10-Feb-09 22:26 
QuestionRe: How to create different Dialogs as Tabs in single window. Pin
B_U_A16-Feb-09 0:53
B_U_A16-Feb-09 0:53 
AnswerRe: How to create different Dialogs as Tabs in single window. Pin
Code-o-mat6-Feb-09 1:28
Code-o-mat6-Feb-09 1:28 
AnswerRe: How to create different Dialogs as Tabs in single window. Pin
Rajesh R Subramanian7-Feb-09 5:36
professionalRajesh R Subramanian7-Feb-09 5:36 
QuestionFolder Size Pin
john56325-Feb-09 23:49
john56325-Feb-09 23:49 
AnswerRe: Folder Size Pin
prasad_som6-Feb-09 0:51
prasad_som6-Feb-09 0:51 
GeneralRe: Folder Size Pin
john56326-Feb-09 1:22
john56326-Feb-09 1:22 
AnswerRe: Folder Size Pin
prasad_som6-Feb-09 1:58
prasad_som6-Feb-09 1:58 
GeneralRe: Folder Size Pin
Naveen6-Feb-09 2:16
Naveen6-Feb-09 2:16 
GeneralRe: Folder Size Pin
prasad_som6-Feb-09 2:27
prasad_som6-Feb-09 2:27 
GeneralRe: Folder Size Pin
Naveen6-Feb-09 2:39
Naveen6-Feb-09 2:39 
GeneralRe: Folder Size Pin
prasad_som6-Feb-09 4:21
prasad_som6-Feb-09 4:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.