FIX: Printer.Height May Eject the Wrong Amount of Paper with Some Dot Matrix Printers (257777)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q257777 SYMPTOMS
When you are using continuous feed paper (such as pin feed paper), and you assign a value to the Printer.Height property, the amount of paper ejected by the printer may be up to one tenth of one millimeter off the specified height. This small discrepancy may not be visible when printing a single page, but it is cumulative with each page.
CAUSE
Visual Basic incorrectly converts the number assigned to Printer.Height from TWIPS (1440 TWIPS to the inch) to tenths of millimeters, which it uses internally to represent the height.
Prior to Visual Basic 6.0 Service Pack 4, Visual Basic performed the following calculation:
' TMM stands for tenths of millimeters
Const TWIPS_PER_CM = 567
Const TMM_PER_CM = 100
Temp = ValueInTwips * TMM_PER_CM / TWIPS_PER_CM
ValueInTMM = Temp - (Temp - Int(Temp))
' First the wrong conversion factor is used
' and then the result is truncated.
Visual Basic 6.0 Service Pack 4 performs the following calculation:
Const TWIPS_PER_INCH = 1440
Const TMM_PER_INCH = 254
ValueInTMM = Int(ValueInTwips * TMM_PER_INCH / TWIPS_PER_INCH)
RESOLUTION
You can use one of the following techniques to work around the problem:
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the latest service pack for Visual Studio 6.0. For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base: 194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why
194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed To download the latest Visual Studio service pack, visit the following Microsoft Web site: REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
157172 How to Create Custom Forms in Windows NT 4.0
Modification Type: | Minor | Last Reviewed: | 12/12/2005 |
---|
Keywords: | kbBug kbfix kbprint kbVS600sp4fix kbVS600sp5fix KB257777 |
---|
|