Solved

mapping mode prob

Posted on 2003-12-03
3
202 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

810 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