Mfccdc Demonstrates Viewport and Mapmode Use in MFC

ID: Q195028


The information in this article applies to:
  • The Microsoft Foundation Classes (MFC), used with:
    • Microsoft Visual C++, 32-bit Editions, versions 4.0, 4.1, 4.2, 5.0, 6.0


SUMMARY

The Mfccdc sample demonstrates how to set the Mapmode, Viewport, and Window parameters, and draws a rectangle based on given logical coordinates; then, the sample calculates the resulting device units.

The sample shows how to use the following functions:


   SetMapMode()
   SetWindowExt()
   SetViewportExt()
   SetWindowOrg()
   SetViewportOrg()
   LPtoDP()
   NormalizeRect() 


MORE INFORMATION

The following files are available for download from the Microsoft Download Center. Click the file names below to download the files:


Mfccdc.exe

For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address

http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

Steps to Run the Sample

Once the sample is running, parameters to the above-mentioned functions can be changed in a dialog box, which effectively updates the rectangle and the calculated device units.


REFERENCES

VC Online help - "CDC class members" and "Converting from Device Coordinates to Logical Coordinates."

Charles Petzold's book, "Programming Windows," ISBN 1-55615-264-7.

Additional query words: kbDSupport mapmode viewport MM_ISOTROPIC MM_ANISOTROPIC MM_LOENGLISH MM_HIENGLISH MM_TWIPS MM_TEXT

Keywords : kbfile kbMFC kbVC400 kbVC410 kbVC420 kbVC500 kbVC600
Version : winnt:4.0,4.1,4.2,5.0,6.0
Platform : winnt
Issue type :


Last Reviewed: December 13, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.