🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #12506

Re: Windows Printers

#12506
From: John Scott
Date: Tue, 09 Dec 2003 15:39
42 lines
3043 bytes
In my case this won't be a big problem. The printer is exclusively used for
printing these cards, but it would be better if I were to control it.
Here is what I understand I should be trying to do.
1. I need to create a DEVMODE structure in memory.
2. Get the Handle (is this the pointer to the structure?) of the DEVMODE
3. Then the Printer()->GetPrinter() will fill the structure with the current
values.
4. I would then set the specific values as necessary.
5. Then use Printer()->SetPrinter() to apply the new values to the printer.
6. Release the memory used for the DEVMODE

Now I usually use the new operator to create objects in memory so would:

DEVMODE *DeviceMode;
DeviceMode=new DEVMODE;

would this create the structure in memory as you are doing with
GlobalAlloc()

John

"Bob Gonder" <notbg@notmindspring.invalid> wrote in message
news:tvr9tv4cctvuri7np179a37t666i9m1s5u@4ax.com...
> John Scott wrote:
>
> >I wonder if this stuff is necessary. If the printer has the duplex
> >capability and it is enabled then why would I need to use this process to
> >change the setting - it will already be enabled!
>
> Because not every print job needs/wants to print on both sides.
> If duplex were the default, then for instance, invoices (which know
> nothing about duplex, and so won't clear it) would print on both
> sides, and it would be kinda hard to seperate the two invoices.
>
> And, what if the user forgets to set Duplex before printing (or reset
> it after)? If they forget before, they waste cards. If they forget
> after...well....you won't be very well liked.
>
> If you don't manipulate the duplex setting, you do so at your user's
> peril.
>
>
Technical Details
Message-ID: <3fd5ece9@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fc7e524$1@newsgroups.borland.com> <3fca2474@newsgroups.borland.com> <3fcb2567$1@newsgroups.borland.com> <3fcb6984@newsgroups.borland.com> <goumsvolftvangoh1n8i7ktptavi57ut2d@4ax.com> <dsvmsvo53afn3qqk6p2ir6ld5lldimucju@4ax.com> <3fcb93d8@newsgroups.borland.com> <eipnsvs99q92prau97tl685lua6crv6e92@4ax.com> <3fce1fed@newsgroups.borland.com> <eudssvci6j3q0l82ivvfs5oj3i2rn1c5ct@4ax.com> <3fcf5268$1@newsgroups.borland.com> <3fd4b3a4@newsgroups.borland.com> <tvr9tv4cctvuri7np179a37t666i9m1s5u@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,7b2449597708bec
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-12-09 08:09:55 PST
From: "John Scott" <jscott@kw.igs.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3fc7e524$1@newsgroups.borland.com> <3fca2474@newsgroups.borland.com> <3fcb2567$1@newsgroups.borland.com> <3fcb6984@newsgroups.borland.com> <goumsvolftvangoh1n8i7ktptavi57ut2d@4ax.com> <dsvmsvo53afn3qqk6p2ir6ld5lldimucju@4ax.com> <3fcb93d8@newsgroups.borland.com> <eipnsvs99q92prau97tl685lua6crv6e92@4ax.com> <3fce1fed@newsgroups.borland.com> <eudssvci6j3q0l82ivvfs5oj3i2rn1c5ct@4ax.com> <3fcf5268$1@newsgroups.borland.com> <3fd4b3a4@newsgroups.borland.com> <tvr9tv4cctvuri7np179a37t666i9m1s5u@4ax.com>
Subject: Re: Windows Printers
Date: Tue, 9 Dec 2003 10:39:14 -0500
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 216.16.227.113
Message-ID: <3fd5ece9@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1070984425 216.16.227.113 (9 Dec 2003 07:40:25 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail