Click here to Skip to main content
14,241,248 members

C / C++ / MFC

 
AnswerRe: How to recognize a MutliTouch Input Event ? Pin
k505418-Jan-19 5:18
memberk505418-Jan-19 5:18 
QuestionToolbar for bottom split window - CSplitterWnd Pin
Anu_Bala15-Jan-19 23:31
memberAnu_Bala15-Jan-19 23:31 
AnswerRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov15-Jan-19 23:44
memberVictor Nijegorodov15-Jan-19 23:44 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 0:09
memberAnu_Bala16-Jan-19 0:09 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov16-Jan-19 1:02
memberVictor Nijegorodov16-Jan-19 1:02 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 1:39
memberAnu_Bala16-Jan-19 1:39 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov16-Jan-19 3:41
memberVictor Nijegorodov16-Jan-19 3:41 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 17:26
memberAnu_Bala16-Jan-19 17:26 
If i use
class CSplitFrame : public CframeWnd


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

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
// 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

class CSplitFrame : public CMDIChildWnd


IT shows assertion error in winmdi.cpp
// 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
class CTrendView : public CView


TrendListView base class is also CView

class CTrendListView : public CView


Im invoking this TrendListView as follow

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
memberVictor Nijegorodov17-Jan-19 8:47 
QuestionAre there programmers that are currently using machine code and Assembly? Pin
Quantum Robin13-Jan-19 7:53
memberQuantum Robin13-Jan-19 7:53 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
HS_C_Student13-Jan-19 10:56
memberHS_C_Student13-Jan-19 10:56 
GeneralRe: Are there programmers that are currently using machine code and Assembly? Pin
HS_C_Student13-Jan-19 11:11
memberHS_C_Student13-Jan-19 11:11 
GeneralRe: Are there programmers that are currently using machine code and Assembly? Pin
Quantum Robin13-Jan-19 16:39
memberQuantum Robin13-Jan-19 16:39 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
leon de boer13-Jan-19 16:34
memberleon de boer13-Jan-19 16:34 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
CPallini13-Jan-19 21:26
mveCPallini13-Jan-19 21:26 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
Joe Woodbury14-Jan-19 6:25
professionalJoe Woodbury14-Jan-19 6:25 
JokeRe: Are there programmers that are currently using machine code and Assembly? Pin
Quantum Robin14-Jan-19 13:52
memberQuantum Robin14-Jan-19 13:52 
Questionerror: expected identifier before string constant Pin
Vaclav_13-Jan-19 6:28
memberVaclav_13-Jan-19 6:28 
AnswerRe: error: expected identifier before string constant Pin
Richard MacCutchan13-Jan-19 6:49
protectorRichard MacCutchan13-Jan-19 6:49 
GeneralRe: error: expected identifier before string constant Pin
Vaclav_13-Jan-19 7:21
memberVaclav_13-Jan-19 7:21 
GeneralRe: error: expected identifier before string constant Pin
Richard MacCutchan13-Jan-19 22:29
protectorRichard MacCutchan13-Jan-19 22:29 
GeneralRe: error: expected identifier before string constant Pin
Stefan_Lang16-Jan-19 23:28
memberStefan_Lang16-Jan-19 23:28 
GeneralRe: error: expected identifier before string constant Pin
Richard MacCutchan16-Jan-19 23:56
protectorRichard MacCutchan16-Jan-19 23:56 
GeneralRe: error: expected identifier before string constant Pin
Stefan_Lang17-Jan-19 1:30
memberStefan_Lang17-Jan-19 1:30 
AnswerRe: error: expected identifier before string constant Pin
k505413-Jan-19 8:29
memberk505413-Jan-19 8: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.