Article View: comp.os.ms-windows.programmer.misc
Article #1760Re: VB, Windows and printing
From: Tommy Petersson
Date: Tue, 22 Dec 1992 17:11
Date: Tue, 22 Dec 1992 17:11
50 lines
2849 bytes
2849 bytes
tope@enea.se (Tommy Petersson) writes: : We are doing a small application in Visual Basic 2.0 Pro, to run on : Windows 3.1 clients in a Lan Manager Network. : : Reports from our application need to be printed in landscape orientation : on a Nec PostScript laser printer. This is easy by selecting landscape : mode in Control Panel/Printer. However, everything else the users print : should be portrait, and they of course don't want to manually change the : preferences all the time. : : There seem to be two choices here: : : Let Visual Basic still use the "Printer" object, (which only works on : the default printer). For every report in our application, set the printer : to landscape, and reset it afterwards. : : Forget about the Printer object, stuff the default printer, use Windows : calls to get/change device context and don't mess with the default printer : whatsoever. : : Which is best? Or is there a better way of doing it? : : In "your best solution" - how do you do it? (I have looked only briefly : on the GetDeviceContext, ExtDeviceMode, Escape and other calls) : : Pro's and con's? : : -- : ============================================================================= : Tommy Petersson tope@enea.se Enea Data AB, Sweden : ============================================================================= Microsoft Support recommended me to use the Escape call, and sent me an example. This example initially states that you shouldn't use Escape but DeviceCapabilities/ExtDeviceMode instead...:-) ExtDeviceMode and many other functions are not listed in the "Win 3.1 API Help" file. MS Support didn't know this, and couldn't give any explanation. They however had the same guess, that it may be problematic to implement them. Maybe it's because of a problem to pass a parameter that is an address to a structure containing a C string? If anyone's interested: I found out that ResetDC can change paper orientation during printing of a document, not only between documents as with Escape. It's however not listed in "Win 3.1 API Help" either. -- ============================================================================= Tommy Petersson tope@enea.se Enea Data AB, Sweden =============================================================================
Technical Details
Message-ID:
<1992Dec22.171145.21177@enea.se>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!sunic!seunet!enea!topeReferences:
<1992Dec21.132516.21464@enea.se>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!sunic!seunet!enea!tope From: tope@enea.se (Tommy Petersson) Subject: Re: VB, Windows and printing Message-ID: <1992Dec22.171145.21177@enea.se> Organization: Enea Data AB X-Newsreader: Tin 1.1 PL3 References: <1992Dec21.132516.21464@enea.se> Date: Tue, 22 Dec 1992 17:11:45 GMT Lines: 51