Click here to Skip to main content
15,922,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Difference among INT, INT32, LONG, LONG32...? Pin
SandipG 2-Jun-08 1:10
SandipG 2-Jun-08 1:10 
GeneralRe: Difference among INT, INT32, LONG, LONG32...? Pin
Maxim Zarus2-Jun-08 1:21
Maxim Zarus2-Jun-08 1:21 
GeneralRe: Difference among INT, INT32, LONG, LONG32...? Pin
SandipG 2-Jun-08 1:27
SandipG 2-Jun-08 1:27 
GeneralRe: Difference among INT, INT32, LONG, LONG32...? Pin
Maxim Zarus2-Jun-08 1:37
Maxim Zarus2-Jun-08 1:37 
QuestionRe: Difference among INT, INT32, LONG, LONG32...? Pin
CPallini2-Jun-08 1:39
mveCPallini2-Jun-08 1:39 
AnswerRe: Difference among INT, INT32, LONG, LONG32...? Pin
Maxim Zarus2-Jun-08 1:48
Maxim Zarus2-Jun-08 1:48 
QuestionRe: Difference among INT, INT32, LONG, LONG32...? Pin
Maxim Zarus2-Jun-08 1:54
Maxim Zarus2-Jun-08 1:54 
AnswerRe: Difference among INT, INT32, LONG, LONG32...? Pin
CPallini2-Jun-08 7:26
mveCPallini2-Jun-08 7:26 
GeneralRe: Difference among INT, INT32, LONG, LONG32...? [modified] Pin
SandipG 2-Jun-08 1:41
SandipG 2-Jun-08 1:41 
GeneralRe: Difference among INT, INT32, LONG, LONG32...? Pin
Rajkumar R2-Jun-08 1:59
Rajkumar R2-Jun-08 1:59 
AnswerRe: Difference among INT, INT32, LONG, LONG32...? Pin
Rajkumar R2-Jun-08 1:58
Rajkumar R2-Jun-08 1:58 
GeneralRe: Difference among INT, INT32, LONG, LONG32...? Pin
SandipG 2-Jun-08 2:03
SandipG 2-Jun-08 2:03 
GeneralRe: Difference among INT, INT32, LONG, LONG32...? Pin
Maxim Zarus2-Jun-08 2:08
Maxim Zarus2-Jun-08 2:08 
AnswerRe: Difference among INT, INT32, LONG, LONG32...? Pin
KarstenK2-Jun-08 2:40
mveKarstenK2-Jun-08 2:40 
QuestionUpdateAllViews Pin
sawerr2-Jun-08 0:35
sawerr2-Jun-08 0:35 
Hi
When clicks on View, my program draws ellipse and I tried to make all changes in one view reflects to all views.

1-)OnLbuttonDown adds a point to CArray m_PointList

2-)UpdateAllViews calls OnUpdate

3-) OnUpdate Invaliates so OnDraw called.


void CDocumentView::OnLButtonDown(UINT nFlags, CPoint point)
{
	GetDocument()->m_PointList.Add(point);
	GetDocument()->UpdateAllViews(NULL);

	CView::OnLButtonDown(nFlags, point);
};
//
void CDocumentView::OnDraw(CDC* pDC)
{
	CDocumentDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	if (!pDoc)
		return;
	for(int i = 0; i < GetDocument()->m_PointList.GetCount(); i++)
	{
		pDC->Ellipse(GetDocument()->m_PointList[i].x - GetDocument()->m_PointSize, 
                             GetDocument()->m_PointList[i].y - GetDocument()->m_PointSize,
			     GetDocument()->m_PointList[i].x + GetDocument()->m_PointSize, 
                             GetDocument()->m_PointList[i].y + GetDocument()->m_PointSize);
	}
}
//
void CDocumentView::OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* 
/*pHint*/)
{
	// TODO: Add your specialized code here and/or call the base class
	Invalidate();
}



But when i open a new document, it doesn't draw ellipse which is m_PointList , it shows a clean view window. And when i started to click also it doesn't change the other views.

Where am i wrong?
AnswerRe: UpdateAllViews Pin
SandipG 2-Jun-08 1:13
SandipG 2-Jun-08 1:13 
GeneralRe: UpdateAllViews Pin
sawerr2-Jun-08 1:32
sawerr2-Jun-08 1:32 
GeneralRe: UpdateAllViews Pin
SandipG 2-Jun-08 1:38
SandipG 2-Jun-08 1:38 
GeneralRe: UpdateAllViews Pin
sawerr2-Jun-08 1:48
sawerr2-Jun-08 1:48 
GeneralRe: UpdateAllViews Pin
SandipG 2-Jun-08 1:57
SandipG 2-Jun-08 1:57 
AnswerRe: UpdateAllViews Pin
Nelek2-Jun-08 4:43
protectorNelek2-Jun-08 4:43 
QuestionA Simple Password Generator Pin
Werty fool2-Jun-08 0:27
Werty fool2-Jun-08 0:27 
AnswerRe: A Simple Password Generator Pin
CPallini2-Jun-08 0:52
mveCPallini2-Jun-08 0:52 
AnswerRe: A Simple Password Generator Pin
James R. Twine2-Jun-08 2:54
James R. Twine2-Jun-08 2:54 
GeneralRe: A Simple Password Generator Pin
Werty fool2-Jun-08 5:32
Werty fool2-Jun-08 5:32 

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.