Click here to Skip to main content
15,885,366 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
QuestionAre there programmers that are currently using machine code and Assembly? Pin
Quantum Robin13-Jan-19 7:53
Quantum 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
HS_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
HS_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
Quantum 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
leon 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
Quantum Robin14-Jan-19 13:52 
Questionerror: expected identifier before string constant Pin
Vaclav_13-Jan-19 6:28
Vaclav_13-Jan-19 6:28 
AnswerRe: error: expected identifier before string constant Pin
Richard MacCutchan13-Jan-19 6:49
mveRichard MacCutchan13-Jan-19 6:49 
GeneralRe: error: expected identifier before string constant Pin
Vaclav_13-Jan-19 7:21
Vaclav_13-Jan-19 7:21 
GeneralRe: error: expected identifier before string constant Pin
Richard MacCutchan13-Jan-19 22:29
mveRichard MacCutchan13-Jan-19 22:29 
GeneralRe: error: expected identifier before string constant Pin
Stefan_Lang16-Jan-19 23:28
Stefan_Lang16-Jan-19 23:28 
GeneralRe: error: expected identifier before string constant Pin
Richard MacCutchan16-Jan-19 23:56
mveRichard MacCutchan16-Jan-19 23:56 
GeneralRe: error: expected identifier before string constant Pin
Stefan_Lang17-Jan-19 1:30
Stefan_Lang17-Jan-19 1:30 
AnswerRe: error: expected identifier before string constant Pin
k505413-Jan-19 8:29
mvek505413-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.