Click here to Skip to main content
15,887,083 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSaving function pointers in Map Pin
Chanchalgaud29-Dec-09 3:29
Chanchalgaud29-Dec-09 3:29 
AnswerRe: Saving function pointers in Map Pin
Richard MacCutchan29-Dec-09 4:44
mveRichard MacCutchan29-Dec-09 4:44 
AnswerRe: Saving function pointers in Map Pin
Abhi Lahare29-Dec-09 4:58
Abhi Lahare29-Dec-09 4:58 
QuestionAnyway to stop a CView from being closed? Pin
Paul Belikian29-Dec-09 3:25
Paul Belikian29-Dec-09 3:25 
AnswerRe: Anyway to stop a CView from being closed? Pin
David Crow29-Dec-09 3:31
David Crow29-Dec-09 3:31 
GeneralRe: Anyway to stop a CView from being closed? Pin
Paul Belikian29-Dec-09 4:14
Paul Belikian29-Dec-09 4:14 
QuestionRe: Anyway to stop a CView from being closed? Pin
David Crow29-Dec-09 4:21
David Crow29-Dec-09 4:21 
AnswerRe: Anyway to stop a CView from being closed? Pin
Paul Belikian29-Dec-09 6:08
Paul Belikian29-Dec-09 6:08 
Mainframe seems to work fine and stops the thread running in the mainframe. However I need to stop the view from closing before the view's thread is stopped (each view has it's own thread and the mainframe has another thread):

void CMainFrame::OnClose()
{
#ifdef _USE_BACKGROUND_THREAD_
	DWORD dwExitCode;
	m_pBackThread->Stop(dwExitCode, 0);
	if(m_pBackThread->GetActivityStatus() != CThread::THREAD_RUNNING) 
	{
		TRACE("Mainframe: Thread Busy, Can't close yet...\n");
		PostMessage(WM_CLOSE); 
	}
	else 
	{ 
		TRACE("Mainframe: Can close now\n");
		m_pBackThread->Stop(dwExitCode);
		
		// Save the current state for tool bars and menus.
		SaveCommandBars(_T("CommandBars"));
		
		// Save the current state for docking panes.
		CXTPDockingPaneLayout layoutNormal(&m_paneManager);
		m_paneManager.GetLayout(&layoutNormal);
		layoutNormal.Save(_T("NormalLayout"));
		
		CMDIFrameWnd::OnClose();
   } 
#else
	// Save the current state for tool bars and menus.
	SaveCommandBars(_T("CommandBars"));
	
	// Save the current state for docking panes.
	CXTPDockingPaneLayout layoutNormal(&m_paneManager);
	m_paneManager.GetLayout(&layoutNormal);
	layoutNormal.Save(_T("NormalLayout"));
	
	CMDIFrameWnd::OnClose();
#endif

}

GeneralRe: Anyway to stop a CView from being closed? Pin
JudyL_MD29-Dec-09 16:50
JudyL_MD29-Dec-09 16:50 
GeneralRe: Anyway to stop a CView from being closed? Pin
Paul Belikian29-Dec-09 17:37
Paul Belikian29-Dec-09 17:37 
QuestionIdeas for an embedded interactive console? Pin
z33z29-Dec-09 3:24
z33z29-Dec-09 3:24 
AnswerRe: Ideas for an embedded interactive console? Pin
raja jamwal31-Dec-09 8:30
raja jamwal31-Dec-09 8:30 
QuestionIs there any way to execute XQuery through MFC or C++ Pin
A&Ms29-Dec-09 3:06
A&Ms29-Dec-09 3:06 
QuestionWhen my article will be publish?How many days in general? Pin
JunWang16329-Dec-09 0:29
JunWang16329-Dec-09 0:29 
AnswerWrong forum. Pin
CPallini29-Dec-09 0:47
mveCPallini29-Dec-09 0:47 
Questioncreating dbf file and reading info from dbf Pin
kir_MFC29-Dec-09 0:18
kir_MFC29-Dec-09 0:18 
QuestionRe: creating dbf file and reading info from dbf Pin
KingsGambit29-Dec-09 0:36
KingsGambit29-Dec-09 0:36 
AnswerRe: creating dbf file and reading info from dbf Pin
kir_MFC29-Dec-09 2:05
kir_MFC29-Dec-09 2:05 
GeneralRe: creating dbf file and reading info from dbf Pin
mav@octaval29-Dec-09 2:10
mav@octaval29-Dec-09 2:10 
AnswerRe: creating dbf file and reading info from dbf Pin
dxlee29-Dec-09 3:21
dxlee29-Dec-09 3:21 
AnswerRe: creating dbf file and reading info from dbf Pin
David Crow29-Dec-09 3:34
David Crow29-Dec-09 3:34 
AnswerRe: creating dbf file and reading info from dbf Pin
Hamid_RT29-Dec-09 19:34
Hamid_RT29-Dec-09 19:34 
QuestionTwo Dialogs in Application class Pin
Anu_Bala28-Dec-09 22:46
Anu_Bala28-Dec-09 22:46 
AnswerRe: Two Dialogs in Application class Pin
KingsGambit28-Dec-09 23:28
KingsGambit28-Dec-09 23:28 
GeneralRe: Two Dialogs in Application class Pin
Anu_Bala28-Dec-09 23:59
Anu_Bala28-Dec-09 23:59 

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.