Knowledge Base

Mfccdc Demonstrates Viewport and Mapmode Use in MFC

Article ID: 195028

Article Last Modified on 11/21/2006


APPLIES TO


This article was previously published under Q195028
NOTE: Microsoft Visual C++ .NET (2002) and Microsoft Visual C++ .NET (2003) support both the managed code model that is provided by the .NET Framework and the unmanaged native Windows code model. The information in this article applies to unmanaged Visual C++ code only.

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:

Visual C++ 6.0

The following file is available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

Visual C++ .NET

The following file is available for download from the Microsoft Download Center:
Release Date: June 25, 2002

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

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 Mfccdc Mfccdcvcnet

Keywords: kbfile kbgdi kbhowto KB195028