Article View: borland.public.cppbuilder.nativeapi
Article #15075Re: TPrinter Problem
From: Fishface
Date: Sat, 19 Jul 2003 15:06
Date: Sat, 19 Jul 2003 15:06
32 lines
2529 bytes
2529 bytes
Anthony wrote: > I tried the following test code: > > Printer()->PrinterIndex = index; > HPrinterDC=Printer()->Handle; > int width = GetDeviceCaps(HPrinterDC, PHYSICALWIDTH); // page size x > in pixels > Printer()->BeginDoc(); > HPrinterDC=Printer()->Handle; > width = GetDeviceCaps(HPrinterDC, PHYSICALWIDTH); // page size x in > pixels > > HPrinterDC and width are the same before and after BeginDoc() is called. It > would appear that the HDC is valid (incorrect but valid) before BeginDoc() > is called. I am still using version 5, but nevertheless checked the source code. I found something that didn't look right in the TPrinter::SetPrinterIndex() PrinterIndex property setter function. I did a Google groups search as follows: group:*delphi* setprinterindex ...because there are more people using Delphi, and I never mind accepting help from them! I found some interesting threads. The workaround for changing the printer may involve something like the one shown in the "vcl\dialog controls\tprintersetupdialog" link on this page: http://info.borland.com/devsupport/delphi/fixes/delphi4/vcl.html It looks like the problem has been around for quite a while. If they can't fix something in five years or so, maybe they could at least get something into the help files...
Technical Details
Message-ID:
<3f195e61@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f1460f3$1@newsgroups.borland.com> <3f14693d$1@newsgroups.borland.com> <3f1471c0$1@newsgroups.borland.com> <3f147649$1@newsgroups.borland.com> <3f148037@newsgroups.borland.com> <3f180395@newsgroups.borland.com> <3f1811af@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-19 08:09:12 PST From: "Fishface" <invalid@ddress.ok?> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f1460f3$1@newsgroups.borland.com> <3f14693d$1@newsgroups.borland.com> <3f1471c0$1@newsgroups.borland.com> <3f147649$1@newsgroups.borland.com> <3f148037@newsgroups.borland.com> <3f180395@newsgroups.borland.com> <3f1811af@newsgroups.borland.com> Subject: Re: TPrinter Problem Date: Sat, 19 Jul 2003 08:06:29 -0700 Lines: 34 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 209.102.126.141 Message-ID: <3f195e61@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1058627169 209.102.126.141 (19 Jul 2003 08:06:09 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail