Click here to Skip to main content
15,180,249 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to recognize a MutliTouch Input Event ? Pin
k505418-Jan-19 6:18
mvek505418-Jan-19 6:18 
QuestionToolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 0:31
MemberAnu_Bala16-Jan-19 0:31 
AnswerRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov16-Jan-19 0:44
MemberVictor Nijegorodov16-Jan-19 0:44 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 1:09
MemberAnu_Bala16-Jan-19 1:09 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov16-Jan-19 2:02
MemberVictor Nijegorodov16-Jan-19 2:02 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 2:39
MemberAnu_Bala16-Jan-19 2:39 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov16-Jan-19 4:41
MemberVictor Nijegorodov16-Jan-19 4:41 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 18:26
MemberAnu_Bala16-Jan-19 18: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 9:47
MemberVictor Nijegorodov17-Jan-19 9:47 
QuestionAre there programmers that are currently using machine code and Assembly? Pin
Quantum Robin13-Jan-19 8:53
MemberQuantum Robin13-Jan-19 8:53 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
HS_C_Student13-Jan-19 11:56
MemberHS_C_Student13-Jan-19 11:56 
GeneralRe: Are there programmers that are currently using machine code and Assembly? Pin
HS_C_Student13-Jan-19 12:11
MemberHS_C_Student13-Jan-19 12:11 
GeneralRe: Are there programmers that are currently using machine code and Assembly? Pin
Quantum Robin13-Jan-19 17:39
MemberQuantum Robin13-Jan-19 17:39 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
leon de boer13-Jan-19 17:34
Memberleon de boer13-Jan-19 17:34 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
CPallini13-Jan-19 22:26
mveCPallini13-Jan-19 22:26 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
Joe Woodbury14-Jan-19 7:25
professionalJoe Woodbury14-Jan-19 7:25 
JokeRe: Are there programmers that are currently using machine code and Assembly? Pin
Quantum Robin14-Jan-19 14:52
MemberQuantum Robin14-Jan-19 14:52 
Questionerror: expected identifier before string constant Pin
Vaclav_13-Jan-19 7:28
MemberVaclav_13-Jan-19 7:28 
AnswerRe: error: expected identifier before string constant Pin
Richard MacCutchan13-Jan-19 7:49
mveRichard MacCutchan13-Jan-19 7:49 
GeneralRe: error: expected identifier before string constant Pin
Vaclav_13-Jan-19 8:21
MemberVaclav_13-Jan-19 8:21 
GeneralRe: error: expected identifier before string constant Pin
Richard MacCutchan13-Jan-19 23:29
mveRichard MacCutchan13-Jan-19 23:29 
GeneralRe: error: expected identifier before string constant Pin
Stefan_Lang17-Jan-19 0:28
mveStefan_Lang17-Jan-19 0:28 
GeneralRe: error: expected identifier before string constant Pin
Richard MacCutchan17-Jan-19 0:56
mveRichard MacCutchan17-Jan-19 0:56 
GeneralRe: error: expected identifier before string constant Pin
Stefan_Lang17-Jan-19 2:30
mveStefan_Lang17-Jan-19 2:30 
AnswerRe: error: expected identifier before string constant Pin
k505413-Jan-19 9:29
mvek505413-Jan-19 9:29 

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.