Article View: borland.public.cppbuilder.nativeapi
Article #13900Re: GetDeviceCaps not working with all printers.
From: Bob Gonder
Date: Mon, 15 Sep 2003 20:47
Date: Mon, 15 Sep 2003 20:47
19 lines
1840 bytes
1840 bytes
Bob Reeves wrote: >Did a little more testing this morning and the problem is with >Printer()->Handle... > >If I add "Printer()->Handle" to the watch list and trace through the code >with PrinterIndex set to one of the problem printers, Builder crashes big >time. If I set PrinterIndex to one of the good printers it evaluates to a >good handle and works fine. > >Any Ideas??? Yeah, 2: Check the Handle and refuse to process invalid ones so you don't AV. (How you do that is up to you..you might pop up a message about it if you think the user needs to know). Or, switch to WinApi methods so that you know exactly what the code is doing, and why the hDC is invalid (if it still is).
Technical Details
Message-ID:
<mt8cmv87t2bgoskujj213hb8okuu51gkct@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f6307be$1@newsgroups.borland.com> <3ti6mvopr70gvqksnpvqnmaongfrhu8fdc@4ax.com> <3f63ab80@newsgroups.borland.com> <3f63acef$1@newsgroups.borland.com> <3f65a5f6$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,90fc2fd2df76ffd6 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-15 13:53:26 PST From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: GetDeviceCaps not working with all printers. Date: Mon, 15 Sep 2003 13:47:18 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <mt8cmv87t2bgoskujj213hb8okuu51gkct@4ax.com> References: <3f6307be$1@newsgroups.borland.com> <3ti6mvopr70gvqksnpvqnmaongfrhu8fdc@4ax.com> <3f63ab80@newsgroups.borland.com> <3f63acef$1@newsgroups.borland.com> <3f65a5f6$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.31.164.3 X-Trace: newsgroups.borland.com 1063658839 67.31.164.3 (15 Sep 2003 13:47:19 -0700) Lines: 22 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail