Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: debugging a Boost serialization assertion Pin
Jochen Arndt5-Mar-18 22:32
professionalJochen Arndt5-Mar-18 22:32 
GeneralRe: debugging a Boost serialization assertion Pin
Alexander Kindel5-Mar-18 23:48
Alexander Kindel5-Mar-18 23:48 
QuestionDouble Click on ProgressBar Pin
Fedrer5-Mar-18 20:09
Fedrer5-Mar-18 20:09 
QuestionRe: Double Click on ProgressBar Pin
Maciej Los5-Mar-18 20:24
mveMaciej Los5-Mar-18 20:24 
AnswerRe: Double Click on ProgressBar Pin
Fedrer5-Mar-18 20:42
Fedrer5-Mar-18 20:42 
QuestionRe: Double Click on ProgressBar Pin
David Crow6-Mar-18 2:24
David Crow6-Mar-18 2:24 
AnswerRe: Double Click on ProgressBar Pin
Victor Nijegorodov5-Mar-18 21:16
Victor Nijegorodov5-Mar-18 21:16 
QuestionHow to add tabs to CView Class? Pin
Sampath5794-Mar-18 22:42
Sampath5794-Mar-18 22:42 
Hi Everyone.

I am working on a MFC application with a requirement of creating multiple views. So, as part of this, i have created an application and created 4 views ( different windows) using CSplitterWnd class as follows:

BOOL bStatus = GetSplitterObj()->CreateStatic
			(
				this,
				2, // rows
				3  // columns
			);


bStatus = GetSplitterObj()->CreateView
				(
					0,
					0,
					RUNTIME_CLASS (CVisMdiAllView),
					sizeView,
					pContext
				);

bStatus = GetSplitterObj()->CreateView
				(
					0,
					2,
					RUNTIME_CLASS (CVisMdiAllView),
					sizeView,
					pContext
				);

bStatus = GetSplitterObj()->CreateView
				(
					1,
					2,
					RUNTIME_CLASS (CVisMdiAllView),
					sizeView,
					pContext
				);


bStatus = GetSplitterObj()->CreateView
				(
					1,
					0,
					RUNTIME_CLASS (CVisMdiAllTextView),
					sizeView,
					pContext
				);

bStatus = GetSplitterObj()->CreateView
				(
					1,
					1,
					RUNTIME_CLASS(CMyTabClass),//CMyTabClass is derived from CTabView
					sizeView,
					pContext
				);


The above piece of code created 5 different views (windows) in my application. Now my requirement is in one of the views (window) i need to add tabs dynamically. I tried as follows:

CMFCTabCtrl tab;
				if (!tab.Create(CMFCTabCtrl::STYLE_FLAT, CRect(150, 100, 0, 0), GetSplitterObj()->GetPane(1, 1), 1))
				{
					TRACE0("Failed to create output tab window\n");
					return -1;      // fail to create
				}

On Pane(1,1) i need to add tabs, and hence i added above piece of code to create MFC tab. Creation of tab is successful. It returned TRUE, but tab is not visible on that view(window).

May i know what mistake i done in adding a tab to that CView window?

modified 5-Mar-18 5:01am.

AnswerRe: How to add tabs to CView Class? Pin
Victor Nijegorodov5-Mar-18 5:13
Victor Nijegorodov5-Mar-18 5:13 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5795-Mar-18 5:41
Sampath5795-Mar-18 5:41 
GeneralRe: How to add tabs to CView Class? Pin
jeron15-Mar-18 9:31
jeron15-Mar-18 9:31 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5795-Mar-18 18:41
Sampath5795-Mar-18 18:41 
GeneralRe: How to add tabs to CView Class? Pin
_Flaviu5-Mar-18 20:42
_Flaviu5-Mar-18 20:42 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5795-Mar-18 20:43
Sampath5795-Mar-18 20:43 
GeneralRe: How to add tabs to CView Class? Pin
_Flaviu5-Mar-18 22:03
_Flaviu5-Mar-18 22:03 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5795-Mar-18 22:51
Sampath5795-Mar-18 22:51 
GeneralRe: How to add tabs to CView Class? Pin
_Flaviu5-Mar-18 23:21
_Flaviu5-Mar-18 23:21 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5796-Mar-18 0:26
Sampath5796-Mar-18 0:26 
GeneralRe: How to add tabs to CView Class? Pin
_Flaviu6-Mar-18 0:33
_Flaviu6-Mar-18 0:33 
GeneralMessage Closed Pin
6-Mar-18 0:44
Sampath5796-Mar-18 0:44 
GeneralRe: How to add tabs to CView Class? Pin
_Flaviu6-Mar-18 1:16
_Flaviu6-Mar-18 1:16 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5796-Mar-18 1:44
Sampath5796-Mar-18 1:44 
GeneralRe: How to add tabs to CView Class? Pin
_Flaviu6-Mar-18 1:50
_Flaviu6-Mar-18 1:50 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5796-Mar-18 4:09
Sampath5796-Mar-18 4:09 
GeneralRe: How to add tabs to CView Class? Pin
_Flaviu6-Mar-18 4:30
_Flaviu6-Mar-18 4:30 

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.