Microsoft KB Archive/195028

= Mfccdc Demonstrates Viewport and Mapmode Use in MFC =

Article ID: 195028

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 4.0 Standard Edition

 Microsoft Visual C++ 4.1 Subscription

 Microsoft Visual C++ 4.2 Enterprise Edition

 Microsoft Visual C++ 5.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 6.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 4.2 Professional Edition</li></ul>

 Microsoft Visual C++ 5.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Standard Edition</li></ul>

 Microsoft Visual C++ .NET 2002 Standard Edition</li></ul> </li> Microsoft Visual C++ .NET 2003 Standard Edition</li></ul>

-

<div class="notice_section">

This article was previously published under Q195028

<div class="notice_section">

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.

<div class="summary_section">

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: <pre class="fixed_text">  SetMapMode SetWindowExt SetViewportExt SetWindowOrg SetViewportOrg LPtoDP NormalizeRect

<div class="moreinformation_section">

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:

Download Mfccdc.exe now

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:

Download Mfccdcvcnet.exe now

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.

<div class="references_section">