FIX: Changing Default Printer Doesn't Effect Printer.FontsLast reviewed: October 30, 1997Article ID: Q99705 |
1.00 2.00 3.00
WINDOWS
kbprint kbprg kbbuglist
The information in this article applies to: - Standard and Professional Editions of Microsoft Visual Basic for Windows, versions 2.0 and 3.0- Microsoft Visual Basic programming system for Windows, version 1.0
SYMPTOMSIf you change the default printer at run time, the Printer.Fonts enumeration is not updated. The Printer.Fonts enumeration is updated only after you print to the new default printer and use the EndDoc method.
WORKAROUNDTo work around to this bug, choose one of these techniques:
EnumFontFamilies or EnumFonts. For a DLL code sample that shows how to enumerate fonts from a DLL, query on the following words in the Microsoft Knowledge Base: EnumFontFamilies AND EnumFontsA disadvantage in using workaround 1 is that it will always cause a blank page to be ejected. A disadvantage of workaround 2 is that you will need to write a DLL using other Windows programming tools such as Microsoft Visual C++.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem has been corrected in Visual Basic version 4.0.
MORE INFORMATIONTo reproduce this bug, you will need to set up two printer devices for two types of printers. For example, you can set up LPT1 to use an Epson printer driver and LPT2 to use an HP LaserJet printer driver. The default printer will need to be set to one of these devices. The steps below demonstrate using the Common Dialog custom control to change the default printer. This control is provided with the Microsoft Visual Basic Professional Toolkit version 1.0, the Microsoft Visual Basic Professional Edition version 2.0, and both the professional and standard editions of Microsoft Visual Basic version 3.0.
Steps to Reproduce Problem
To see a different number of fonts displayed for the new default printer, from the Run menu, choose End (ALT, R, E) to end the program. Then press F5 to run it again, click Form1, and choose OK on the Printer Dialog.
|
Additional reference words: buglist1.00 buglist2.00 buglist3.00 1.00 2.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |