Click here to Skip to main content
15,908,455 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Complex multidimensional array in C++ Pin
Stefan_Lang20-Jan-19 21:29
Stefan_Lang20-Jan-19 21:29 
Questionis there any relation object states control and encapsulation? Pin
nig3D19-Jan-19 8:05
nig3D19-Jan-19 8:05 
AnswerRe: is there any relation object states control and encapsulation? Pin
phil.o19-Jan-19 9:41
professionalphil.o19-Jan-19 9:41 
AnswerRe: is there any relation object states control and encapsulation? Pin
CPallini19-Jan-19 10:34
mveCPallini19-Jan-19 10:34 
JokeRe: is there any relation object states control and encapsulation? Pin
Peter_in_278019-Jan-19 10:51
professionalPeter_in_278019-Jan-19 10:51 
GeneralRe: is there any relation object states control and encapsulation? Pin
nig3D20-Jan-19 4:23
nig3D20-Jan-19 4:23 
GeneralRe: is there any relation object states control and encapsulation? Pin
Peter_in_278020-Jan-19 10:49
professionalPeter_in_278020-Jan-19 10:49 
GeneralRe: is there any relation object states control and encapsulation? Pin
nig3D27-Jan-19 10:25
nig3D27-Jan-19 10:25 
AnswerRe: is there any relation object states control and encapsulation? Pin
leon de boer19-Jan-19 18:47
leon de boer19-Jan-19 18:47 
QuestionWhat are the programmers' opinions about Plain English Programming? Pin
Quantum Robin18-Jan-19 8:04
Quantum Robin18-Jan-19 8:04 
QuestionRe: What are the programmers' opinions about Plain English Programming? Pin
David Crow18-Jan-19 16:21
David Crow18-Jan-19 16:21 
AnswerRe: What are the programmers' opinions about Plain English Programming? Pin
leon de boer19-Jan-19 2:48
leon de boer19-Jan-19 2:48 
GeneralRe: What are the programmers' opinions about Plain English Programming? Pin
Stefan_Lang20-Jan-19 22:08
Stefan_Lang20-Jan-19 22:08 
AnswerRe: What are the programmers' opinions about Plain English Programming? Pin
Alan Balkany22-Jan-19 5:45
Alan Balkany22-Jan-19 5:45 
QuestionHow to recognize a MutliTouch Input Event ? Pin
Member 1406801918-Jan-19 3:11
Member 1406801918-Jan-19 3:11 
AnswerRe: How to recognize a MutliTouch Input Event ? Pin
Victor Nijegorodov18-Jan-19 5:14
Victor Nijegorodov18-Jan-19 5:14 
AnswerRe: How to recognize a MutliTouch Input Event ? Pin
k505418-Jan-19 5:18
mvek505418-Jan-19 5:18 
QuestionToolbar for bottom split window - CSplitterWnd Pin
Anu_Bala15-Jan-19 23:31
Anu_Bala15-Jan-19 23:31 
AnswerRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov15-Jan-19 23:44
Victor Nijegorodov15-Jan-19 23:44 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 0:09
Anu_Bala16-Jan-19 0:09 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov16-Jan-19 1:02
Victor Nijegorodov16-Jan-19 1:02 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 1:39
Anu_Bala16-Jan-19 1:39 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov16-Jan-19 3:41
Victor Nijegorodov16-Jan-19 3:41 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 17:26
Anu_Bala16-Jan-19 17:26 
If i use
C++
class CSplitFrame : public CframeWnd


Here, I call the TrendView using following fucntion in mainfrm.cpp,

C++
void CMainFrame::OnTrendview() 
{
	
	if( pTrendDisplayFrame == NULL )
	{
		iWindowNumber = 4;
		CDocTemplate *pTemplate = theApp.pTrendViewTemplate;
		CCS3OprDoc* pDoc = new CCS3OprDoc;
		pTrendDisplayFrame = (CMDIChildWnd *)pTemplate->CreateNewFrame( pDoc ,NULL );
		if( pTrendDisplayFrame == NULL )
		{
			MessageBox( "Unable to Create Trend Display" );
			return;
		}
		pTemplate->InitialUpdateFrame( pTrendDisplayFrame,NULL );
	}
	else
		MDIActivate( pTrendDisplayFrame );
}

Here it comes messagebox “Unable to create trend display” becoz pTrendDisplayFrmae is null. Frame is not created in CreateNewFrame(),it return null from this function call from doctempl.cpp
C++
// create new from resource
	if (!pFrame->LoadFrame(m_nIDResource,
			WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE,   // default frame styles
			NULL, &context))
	{
		TRACE(traceAppMsg, 0, "Warning: CDocTemplate couldn't create a frame.\n");
		// frame will be deleted in PostNcDestroy cleanup
		return NULL;
	}



When I use CsplitFrame as MDIChilWNd

C++
class CSplitFrame : public CMDIChildWnd


IT shows assertion error in winmdi.cpp
C++
// walk up two parents for MDIFrame that owns MDIChild (skip MDIClient)
CMDIFrameWnd* CMDIChildWnd::GetMDIFrame()
{
	ASSERT_KINDOF(CMDIChildWnd, this);
	ASSERT(m_hWnd != NULL);
	HWND hWndMDIClient = ::GetParent(m_hWnd);
	ASSERT(hWndMDIClient != NULL);

	CMDIFrameWnd* pMDIFrame;
	pMDIFrame = (CMDIFrameWnd*)CWnd::FromHandle(::GetParent(hWndMDIClient));
	ASSERT(pMDIFrame != NULL);
	ASSERT_KINDOF(CMDIFrameWnd, pMDIFrame); //Assertion error occurred here
	ASSERT(pMDIFrame->m_hWndMDIClient == hWndMDIClient);
	ASSERT_VALID(pMDIFrame);
	return pMDIFrame;
}




My TrendView base class is
C++
class CTrendView : public CView


TrendListView base class is also CView

C++
class CTrendListView : public CView


Im invoking this TrendListView as follow

C++
void CMainFrame::OnTrendListView()
{
	// TODO: Add your command handler code here
	iGraphView = 0;	//Code added by Mohan //Graph view inactive
	if( pTrendListDisplayFrame == NULL )
	{
		iWindowNumber = 11;
		CDocTemplate *pTemplate = theApp.pTrendListViewTemplate;
		CCS3OprDoc* pDoc = new CCS3OprDoc;
		pTrendListDisplayFrame = (CMDIChildWnd *)pTemplate->CreateNewFrame( pDoc ,NULL );
		if( pTrendListDisplayFrame == NULL )
		{
			AfxMessageBox( "Unable to Create Tuning Display" );
			return;
		}
		pTemplate->InitialUpdateFrame( pTrendListDisplayFrame ,NULL );
	}
	else
		MDIActivate( pTrendListDisplayFrame );	

}


When i press Trendpage in main menu, this trend view and trendlistview will display in a same page as splitted window. The window will look like
--------------
Main menu
--------------
Toolbar
-------------
TrendView
--------------
another toolbar
---------------
TrendListview

Anu


modified 17-Jan-19 0:09am.

GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov17-Jan-19 8:47
Victor Nijegorodov17-Jan-19 8:47 

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.