Click here to Skip to main content
15,912,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionstrange: why is Font clearer than drawing (2)? Pin
includeh1026-Apr-06 21:33
includeh1026-Apr-06 21:33 
Questiondos aplication Pin
viliam26-Apr-06 21:12
viliam26-Apr-06 21:12 
AnswerRe: dos aplication Pin
Stephen Hewitt26-Apr-06 21:15
Stephen Hewitt26-Apr-06 21:15 
GeneralRe: dos aplication Pin
viliam27-Apr-06 3:21
viliam27-Apr-06 3:21 
GeneralRe: dos aplication Pin
Stephen Hewitt27-Apr-06 13:35
Stephen Hewitt27-Apr-06 13:35 
AnswerRe: dos aplication Pin
Cedric Moonen26-Apr-06 21:17
Cedric Moonen26-Apr-06 21:17 
GeneralRe: dos aplication Pin
viliam27-Apr-06 3:26
viliam27-Apr-06 3:26 
QuestionMDI - Repaint all children Pin
Sarvan AL26-Apr-06 21:07
Sarvan AL26-Apr-06 21:07 
Hi all,

I have an basic MDI application with a view class derived from CView. The view class has a string member(CString m_strTime) to get the system time in its constructor. I am displaying the sting in OnDraw. Now consider that I have opened three child windows.

I have a menu "Update" -> "Reset Time". I want to update all the child windows with the latest time. I am updating the latest time in Application class's member "strAppTime".

Pls look at the code:

CMyView::CMyView()<br />
{<br />
	CTime t = CTime::GetCurrentTime();<br />
	m_strTime = t.Format("%A, %B %d, %Y - %H:%M:%S") ;<br />
}<br />
<br />
<br />
CMyView::OnDraw(..)<br />
{<br />
	CString strTime ;<br />
	<br />
	strTime = ((CMyApp*)AfxGetApp()) ->m_strAppTime ;<br />
	<br />
	if(strTime != "")<br />
		pDC->TextOut(0, 0, strTime) ;<br />
	else<br />
		pDC->TextOut(0, 0, m_strTime) ;<br />
}<br />
<br />
<br />
void CMainFrame::ResetTime() <br />
{<br />
	CMDIChildWnd *pChildWnd = MDIGetActive() ;<br />
	if(!pChildWnd)<br />
		return ;<br />
<br />
	CTime t = CTime::GetCurrentTime();<br />
	((CMyApp*)AfxGetApp()) ->m_strAppTime = <br />
			t.Format("%A, %B %d, %Y - %H:%M:%S") ;<br />
	<br />
	pChildWnd->GetActiveDocument()->UpdateAllViews(NULL) ;<br />
<br />
}


It updates only the active child window. How to make possible for all the children. If I use MDIGetActive() and MDINext(), it changes the window order, as you know. It reflects clearly in Cascade arrangement.

Kindly suggest me a solution.

Thanks in advance,
Sarvan AL
AnswerRe: MDI - Repaint all children Pin
Nibu babu thomas26-Apr-06 21:17
Nibu babu thomas26-Apr-06 21:17 
GeneralRe: MDI - Repaint all children Pin
Sarvan AL26-Apr-06 22:00
Sarvan AL26-Apr-06 22:00 
QuestionCxImage - Add Text to Image Pin
RiHaus26-Apr-06 20:50
RiHaus26-Apr-06 20:50 
Questionmaking a invisible row visible in a data grid in VC++ Pin
helpcode26-Apr-06 19:49
helpcode26-Apr-06 19:49 
AnswerRe: making a invisible row visible in a data grid in VC++ Pin
Cedric Moonen26-Apr-06 21:00
Cedric Moonen26-Apr-06 21:00 
GeneralRe: making a invisible row visible in a data grid in VC++ Pin
helpcode26-Apr-06 23:17
helpcode26-Apr-06 23:17 
GeneralRe: making a invisible row visible in a data grid in VC++ Pin
Cedric Moonen26-Apr-06 23:27
Cedric Moonen26-Apr-06 23:27 
GeneralRe: making a invisible row visible in a data grid in VC++ Pin
helpcode27-Apr-06 1:17
helpcode27-Apr-06 1:17 
Questionwarning C4251 Pin
Naveen26-Apr-06 19:31
Naveen26-Apr-06 19:31 
AnswerRe: warning C4251 Pin
Nibu babu thomas26-Apr-06 19:35
Nibu babu thomas26-Apr-06 19:35 
QuestionDelete the menu Pin
Anu_Bala26-Apr-06 19:27
Anu_Bala26-Apr-06 19:27 
AnswerRe: Delete the menu Pin
Nibu babu thomas26-Apr-06 19:57
Nibu babu thomas26-Apr-06 19:57 
QuestionWhat's the difference between CDialog and CView Pin
Happy frog26-Apr-06 18:45
Happy frog26-Apr-06 18:45 
AnswerRe: What's the difference between CDialog and CView Pin
Hamid_RT26-Apr-06 19:17
Hamid_RT26-Apr-06 19:17 
QuestionC++ STL Question: Using Maps Pin
chasetoys26-Apr-06 17:59
chasetoys26-Apr-06 17:59 
AnswerRe: C++ STL Question: Using Maps Pin
Stephen Hewitt26-Apr-06 18:04
Stephen Hewitt26-Apr-06 18:04 
AnswerRe: C++ STL Question: Using Maps Pin
Christian Graus26-Apr-06 18:07
protectorChristian Graus26-Apr-06 18:07 

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.