Click here to Skip to main content
15,881,173 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5796-Mar-18 4:52
Sampath5796-Mar-18 4:52 
GeneralRe: How to add tabs to CView Class? Pin
Sampath57910-Mar-18 22:06
Sampath57910-Mar-18 22:06 
GeneralRe: How to add tabs to CView Class? Pin
Sampath57910-Mar-18 22:10
Sampath57910-Mar-18 22:10 
If i call AddView() and run my program, its working absolutely fine with a window and a view(tab).
But instead of calling AddView() initially, at runtime based on user input, i called addview() which leads to a crash. What could be the reason.

<pre>class View : public CScrollView
{
	
}

//below is my main class
class MyTabClass : public CTabView
{
	//this function gets called automatically during creation of window.
	void OnCreate(LPCREATESTRUCT lpCreateStruct)
	{
		if (CTabView::OnCreate(lpCreateStruct) == -1)
			return -1;
		AddView(RUNTIME_CLASS(View),_T("Sheet1")); //this works fine.
	}
	
	//this function i will call based on user input and hence its crashing during addView call.
	void RunTimeBasedOnUserInput()
	{
		for(int i = 0 ; i < userinput; i++)
		{
			AddView(RUNTIME_CLASS(View),_T("sheet %d",i));
		}

	}
}

GeneralRe: How to add tabs to CView Class? Pin
_Flaviu6-Mar-18 0:36
_Flaviu6-Mar-18 0:36 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5796-Mar-18 0:45
Sampath5796-Mar-18 0:45 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5796-Mar-18 20:18
Sampath5796-Mar-18 20:18 
GeneralRe: How to add tabs to CView Class? Pin
_Flaviu6-Mar-18 21:01
_Flaviu6-Mar-18 21:01 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5796-Mar-18 21:20
Sampath5796-Mar-18 21:20 
GeneralRe: How to add tabs to CView Class? Pin
_Flaviu6-Mar-18 21:35
_Flaviu6-Mar-18 21:35 
GeneralRe: How to add tabs to CView Class? Pin
Sampath5796-Mar-18 21:51
Sampath5796-Mar-18 21:51 
GeneralRe: How to add tabs to CView Class? Pin
_Flaviu6-Mar-18 22:08
_Flaviu6-Mar-18 22:08 
GeneralRe: How to add tabs to CView Class? Pin
Sampath57910-Mar-18 22:15
Sampath57910-Mar-18 22:15 
GeneralRe: How to add tabs to CView Class? Pin
_Flaviu12-Mar-18 23:43
_Flaviu12-Mar-18 23:43 
QuestionSerializing CMapStringToPtr Pin
_Flaviu4-Mar-18 22:35
_Flaviu4-Mar-18 22:35 
AnswerRe: Serializing CMapStringToPtr Pin
CPallini4-Mar-18 23:29
mveCPallini4-Mar-18 23:29 
QuestionMSXML load - not able to read chinese characters in path Pin
Gopi Nath28-Feb-18 22:25
Gopi Nath28-Feb-18 22:25 
QuestionRe: MSXML load - not able to read chinese characters in path Pin
Richard MacCutchan28-Feb-18 22:52
mveRichard MacCutchan28-Feb-18 22:52 
AnswerRe: MSXML load - not able to read chinese characters in path Pin
Gopi Nath28-Feb-18 23:12
Gopi Nath28-Feb-18 23:12 
GeneralRe: MSXML load - not able to read chinese characters in path Pin
Richard MacCutchan28-Feb-18 23:15
mveRichard MacCutchan28-Feb-18 23:15 
GeneralRe: MSXML load - not able to read chinese characters in path Pin
Gopi Nath28-Feb-18 23:46
Gopi Nath28-Feb-18 23:46 

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.