Microsoft KB Archive/106495

= BUG: VB Printer.Width/Height Values Incorrect for Plotter =

Article ID: 106495

Article Last Modified on 10/30/2003

-

APPLIES TO


 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition

-



This article was previously published under Q106495



SYMPTOMS
If you set up the HP Draftmaster II plotter with a paper size of A0 in the Windows Control Panel, Visual Basic returns incorrect values for the Printer.Width and Printer.Height properties. If you set the plotter's paper size to A3 or A4, then Printer.Width and Printer.Height return correct values.



CAUSE
The Printer.Width and Printer.Height properties are designed to receive an integer only. Plotter paper sizes often exceed an integer. This causes an overflow in the Width and Height properties.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Problem
 Choose the Printers dialog from the Windows Control Panel. Select the "HP Draftmaster II (HP Plotter)" and click Add. Click Install to add this printer to the Installed Printers list.

NOTE: Windows for WorkGroups installs the necessary files in the WINDOWS\SYSTEM directory. Make "HP Draftmaster II (HP Plotter)" the default printer. Click Setup. Select the options DEVICE.DRAFTMASTER II and SIZE.A0. Click OK. Click Close to close the Printers dialog. Start Visual Basic.</li> Press the F5 key followed by CTRL+BREAK.</li>  Activate the Debug window and execute the following statements: Debug.Print Printer.Width Debug.Print Printer.Height </li></ol>

The problem is that Printer.Width and Printer.Height return incorrect values such as 161.

Additional query words: buglist3.00 3.00 Hewlett-Packard H-P

Keywords: kbbug KB106495

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.