BUG: X / Y Coordinates Reversed Using PSet on Printer Object

Last reviewed: October 8, 1996
Article ID: Q150192
The information in this article applies to:
  • Standard, Professional, and Enterprise Editions of Microsoft Visual Basic, 16-bit and 32-bit, for Windows, version 4.0

SYMPTOMS

If the PSet method is invoked for the Printer object, the X and Y coordinates are reversed: the first argument represents the vertical coordinate and the second argument represents the horizontal coordinate.

STATUS

Microsoft has confirmed this to be an issue in the Microsoft products listed at the beginning of this article. Microsoft is researching this issue and will post new information here in the Microsoft Knowledge Base as it becomes available.

WORKAROUND

Invoke the coordinates in reverse order when the PSet method is used for the Printer object.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start a new project in Visual Basic. Form1 is created by default. In the Click event of Form1, place the following code:

       Private Sub Form_Click()
          Dim I As Integer
    
       'Should print a horizontal dotted line
    
           For I = 0 To Printer.ScaleWidth Step 100
    
           Printer.PSet (I, (Printer.ScaleHeight \ 2))
    
           Next
    
    
       Printer.EndDoc
       End Sub
    
    

  2. Run the project by pressing F5. Click on the Form, and it prints out a dotted line to the default printer. The line runs across the paper. Since the default is portrait, the line runs along the short side of the paper. However, the print job contains a line that runs along the vertical axis.

To correct the code above, the order of the arguments to the PSet method can be swapped:

   Printer.PSet ((Printer.ScaleHeight \ 2), I)

This should only be done when the PSet is used with the Printer object.


Additional reference words: 4.00 vb4win vb4all
KBCategory: kbprg kbbuglist
KBSubcategory: PrgOther


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 8, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.