FIX: Internet Explorer Calculates Incorrect Print Margins After You Switch Between Inches and Millimeters Measurement Units (810909)



The information in this article applies to:

  • Microsoft Windows CE Platform Builder 4.1

SYMPTOMS

When you change the printer options in the Internet Explorer SAMPLE component (IESample) from inches to millimeters (or vica versa), the print margins are incorrectly calculated, and the printed page does not appear as expected.
This is caused by a bug in the print dialog code. The default implementation of the print dialog sample code in the IESample component does not correctly calculate the conversion from inches to millimeters.

RESOLUTION

A supported software update is now available from Microsoft as Windows CE 4.1 Core OS QFE 810909. To resolve this problem immediately, click the following article number for information about obtaining Windows CE Platform Builder and core operating system software updates:

837392 How to locate core operating system fixes for Microsoft Windows CE Platform Builder products

For more information about how to implement this fix, see the "More Information" section.

The English version of this update has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version       Size    File name
   ------------------------------------------------------------------------------
   13-Dec-2002  00:07  4.1.2.1212   637,536  021212_armv4i_wce41-q810909.exe  
   13-Dec-2002  00:07  4.1.2.1212   637,536  021212_armv4t_wce41-q810909.exe
   13-Dec-2002  00:07  4.1.2.1212   637,536  021212_armv4_wce41-q810909.exe
   13-Dec-2002  00:07  4.1.2.1212   608,864  021212_mips16_wce41-q810909.exe
   13-Dec-2002  00:07  4.1.2.1212   641,632  021212_mipsii_fp_wce41-q810909.exe
   13-Dec-2002  00:07  4.1.2.1212   641,632  021212_mipsii_wce41-q810909.exe
   13-Dec-2002  00:07  4.1.2.1212   645,728  021212_mipsiv_fp_wce41-q810909.exe
   13-Dec-2002  00:07  4.1.2.1212   645,728  021212_mipsiv_wce41-q810909.exe
   13-Dec-2002  00:07  4.1.2.1212   617,056  021212_sh3_wce41-q810909.exe
   13-Dec-2002  00:07  4.1.2.1212   617,056  021212_sh4_wce41-q810909.exe  
   13-Dec-2002  00:07  4.1.2.1212   588,384  021212_x86_wce41-q810909.exe
	
The English version of this package should have the following file attributes or later:
   Date         Time                      Size    File name
   --------------------------------------------------------------

   Path: Public\Ie\Oak\Lib\Armv4\Debug
   09-Dec-2002  19:49                    585,258  Iepeers.lib
   09-Dec-2002  19:49                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Armv4\Retail
   09-Dec-2002  19:49                    465,606  Iepeers.lib
   09-Dec-2002  19:49                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Armv4i\Debug
   09-Dec-2002  19:49                    586,714  Iepeers.lib
   09-Dec-2002  19:49                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Armv4i\Retail
   09-Dec-2002  19:48                    466,468  Iepeers.lib
   09-Dec-2002  19:48                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Armv4t\Debug
   09-Dec-2002  19:48                    559,778  Iepeers.lib
   09-Dec-2002  19:48                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Armv4t\Retail
   09-Dec-2002  19:48                    463,302  Iepeers.lib
   09-Dec-2002  19:48                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Mips16\Debug
   09-Dec-2002  19:50                    541,660  Iepeers.lib
   09-Dec-2002  19:50                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Mips16\Retail
   09-Dec-2002  19:50                    398,074  Iepeers.lib
   09-Dec-2002  19:50                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Mipsii\Debug
   09-Dec-2002  19:50                    598,026  Iepeers.lib
   09-Dec-2002  19:50                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Mipsii\Retail
   09-Dec-2002  19:49                    467,704  Iepeers.lib
   09-Dec-2002  19:49                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Mipsii_fp\Debug
   09-Dec-2002  19:51                    598,104  Iepeers.lib
   09-Dec-2002  19:51                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Mipsii_fp\Retail
   09-Dec-2002  19:50                    467,788  Iepeers.lib
   09-Dec-2002  19:50                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Mipsiv\Debug
   09-Dec-2002  19:53                    601,826  Iepeers.lib
   09-Dec-2002  19:53                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Mipsiv\Retail
   09-Dec-2002  19:52                    469,816  Iepeers.lib
   09-Dec-2002  19:52                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Mipsiv_fp\Debug
   09-Dec-2002  19:52   601,904  Iepeers.lib
   09-Dec-2002  19:52                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Mipsiv_fp\Retail
   09-Dec-2002  19:51                    469,902  Iepeers.lib
   09-Dec-2002  19:51                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Sh3\Debug
   09-Dec-2002  19:51                    536,512  Iepeers.lib
   09-Dec-2002  19:51                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Sh3\Retail
   09-Dec-2002  19:51                    423,930  Iepeers.lib
   09-Dec-2002  19:51                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Sh4\Debug
   09-Dec-2002  19:52                    536,512  Iepeers.lib
   09-Dec-2002  19:52                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\Sh4\Retail
   09-Dec-2002  19:52                    423,598  Iepeers.lib
   09-Dec-2002  19:52                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\X86\Debug
   09-Dec-2002  19:47                    482,936  Iepeers.lib
   09-Dec-2002  19:47                    192,512  Iepeers.pdb

   Path: Public\Ie\Oak\Lib\X86\Retail
   09-Dec-2002  19:47                    407,830  Iepeers.lib
   09-Dec-2002  19:47                    192,512  Iepeers.pdb

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

To display metric margin data, you also have to change the following source file:

Public\IE\Oak\IEsample\Mainwnd.cpp

To enable this fix, follow these steps:
  1. Change the HandlePageSetup() function to obtain the measurement units that are currently in use by means of the GetLocaleInfo(...,LOCALE_IMEASURE,...) function.
  2. If the current measurement unit is metric, set the PSD_INHUNDREDTHSOFMILLIMETERS constant in the printdlg.Flags variable, and then convert the members of printdlg.rtMargin to metric before you call the PageSetupDlg() function.
For example, the following code shows how to do this for the bottom margin.

Note This code assumes that the value in the registry is stored as inches. Regardless of which measurement unit that you decide to use, you must consistently use that measurement unit for all stored values in the registry.
dwSize = sizeof(DWORD);
if(ERROR_SUCCESS == RegQueryValueEx(hKey, L"margin_bottom", 0, &dwType, (LPBYTE)&dwMargin, &dwSize))
   {
   rcMargin.bottom = dwMargin;
   }
else
   }
   rcMargin.bottom = 750;
   }

if (fIsMetric)
  rcMargin.bottom = ((rc.Margin.bottom * 2540) / 1000)

Modification Type:MinorLast Reviewed:5/27/2005
Keywords:kbfix kbbug kbQFE KB810909 kbAudOEM kbAudDeveloper