Solved

mapping mode prob

Posted on 2003-12-03
3
200 Views
Last Modified: 2013-11-20
hi...i am facing a small prob..

void CEditorView::OnDraw(CDC* pDC)
{
      CEditorDoc* pDoc = GetDocument();
      ASSERT_VALID(pDoc);
      
      //
      //Set the mapping mode to LOENGLISH
      //
      pDC->SetMapMode(MM_LOENGLISH);

      //
      //Convert arguments to coordinates to MM_LOENGLISH units.
      //
      CPoint pos;
      pos.x = pDoc->GetGridWidth()*100;
      pos.y = pDoc->GetGridHeight();
      pDC->DPtoLP(&pos);

      //
      //Draw the square the has to bound the grid
      //
//      CRect rect(10, -10, pos.x, pos.y);//getting wrong rect in this way..WHY?
      CRect rect(10, -10, 2000, -1000);
      pDC->Rectangle(rect);//rectangle drawn okwhen i do this
CRect rect(10, -10, pos.x, pos.y);
the rectangle that is drawn isboundless...i.e no mater how long i put the scroll bars..i still cant see the end of therect..wherea as if i do this
CRect rect(10, -10, 2000, 1000);
i can see the rectangle...
why is that???why cant i see the rect when iuse the first method??
can somebody gimme an explanation pls ????
tks for any help...
0
Comment
Question by:joseph-r-thomas
3 Comments
 
LVL 12

Expert Comment

by:migel
ID: 9868081
Hi!
May be you need to set WindowOrigin with proper walue getted from the scrollPositions?
0
 

Author Comment

by:joseph-r-thomas
ID: 9868098
i dont think u get my question.....
0
 
LVL 13

Accepted Solution

by:
SteH earned 20 total points
ID: 9926576
What values do pos.x and pos.y have?

Why do you use a CPoint to store x and y when you and later get back x and y seperatly? Perhaps using
CPoint ltpos (10, -10);
CRect (ltpos, pos); could be used instead?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 48
zeroFront challenge 7 80
scoreUp challenge 14 57
Way to decrease size of apk file 9 45
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now