🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TPrinter Problem

#15103
From: Alan Bellingham
Date: Tue, 15 Jul 2003 23:49
34 lines
2570 bytes
"Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> wrote:

>"Anthony" <awhitesell@attbi.com> wrote in message
>news:3f1460f3$1@newsgroups.borland.com...
>
>> my_hdc1, my_hdc2, my_hdc3, my_hdc4 are all same.  Meaning that you cannot
>> get the handle of any printer other than the handle to the default
>printer.
>> What use is this?  How do you get the handle of a printer other than the
>> default?
>
>Call the Win32 API CreateIC() function directly.  Check if it is doing the
>same thing.  If it is, then there is nothing TPrinter can do about it, the
>OS itself is returning the wrong HDC in the first place.  CreateIC() is the
>function that is uses to get the HDC for each printer.

And there's a possibility that, though the value is the same, that the
content isn't.

It wouldn't surprise me to find the HDC being released back to Windows
when the next printer is indexed, and Windows then generating a new DC
in the same place for the new handle.

The whole concept of using the Printer object is not one I've tried - my
printer code is all written using the underlying API, with
DocumentProperties() and OpenPrinter() and ResetDC() and the like. I
suspect that the Printer object is fine for simple use (printing
reports, say), but may be a little limited for advanced usage.

Alan Bellingham
-- 
Me <url:mailto:alanb@episys.com> <url:http://www.doughnut.demon.co.uk/>
ACCU - C, C++ and Java programming               <url:http://accu.org/>
The 2004 Discworld Convention                   <url:http://dwcon.org/>
Technical Details
Message-ID: <qgq8hv4fn52ds00n5hv0602s8hfm6lksbv@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3f1460f3$1@newsgroups.borland.com> <3f14693d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,d59131589fe63384
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-15 17:03:04 PST
From: Alan Bellingham <alanb@episys.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: TPrinter Problem
Date: Wed, 16 Jul 2003 00:49:30 +0100
Reply-To: alanb@episys.com
Message-ID: <qgq8hv4fn52ds00n5hv0602s8hfm6lksbv@4ax.com>
References: <3f1460f3$1@newsgroups.borland.com> <3f14693d$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 62.49.31.105
X-Trace: newsgroups.borland.com 1058312968 62.49.31.105 (15 Jul 2003 16:49:28 -0700)
Lines: 34
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail