Article View: borland.public.cppbuilder.nativeapi
Article #15099Re: TPrinter Problem
From: Anthony
Date: Tue, 15 Jul 2003 21:20
Date: Tue, 15 Jul 2003 21:20
42 lines
2476 bytes
2476 bytes
Gambit, I can use both HDC HPrinterDC = CreateDC(NULL, Device.c_str(), NULL, pdm); and HDC HPrinterDC = CreateIC(NULL, Device.c_str(), NULL, pdm); and get the correct page sizes. Which is the correct one to use? Why is Printer()->Handle not returning the correct handle? I have tried it on two Win98 and on one Win2k machine all with the same result, is there a fix? I can print to any printer correctly with Printer(), the Handle seems to be the only part not working. Is all the functionality of Printer() available by using the HDC of the printer from the first included code line? I have used the VCL extensively and have not ventured into the WIN32 API, so please pardon my novice-ness. "Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message news:3f14693d$1@newsgroups.borland.com... > > "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. > > > Gambit > >
Technical Details
Message-ID:
<3f1471c0$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!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>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 14:41:29 PST From: "Anthony" <awhitesell@attbi.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f1460f3$1@newsgroups.borland.com> <3f14693d$1@newsgroups.borland.com> Subject: Re: TPrinter Problem Date: Tue, 15 Jul 2003 17:20:45 -0400 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: 24.128.134.183 Message-ID: <3f1471c0$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1058304448 24.128.134.183 (15 Jul 2003 14:27:28 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail