🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TPrinter Problem

#15054
From: Anthony
Date: Fri, 18 Jul 2003 15:19
38 lines
2260 bytes
Fishface,

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.

All suggestions are appreciated and tried.

Thanx,
Anthony



"Fishface" <invalid@ddress.ok?> wrote in message
news:3f180395@newsgroups.borland.com...
> Anthony wrote:
>
> > I was getting the wrong page sizes with:
> > (A)
> > Printers()->PrinterIndex=x;
> > width=GetDeviceCaps(Printers()->Handle, PHYSICALWIDTH);
>
> It has been my understanding that the printer HDC is not valid until
> BeginDoc() is called, which may be the cause of all your problems.
> The HDC is released by a call to Abort() of EndDoc().
>
>
Technical Details
Message-ID: <3f1811af@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!205.215.62.125.MISMATCH!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
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>

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-18 08:41:14 PST
From: "Anthony" <awhitesell@attbi.com>
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>
Subject: Re: TPrinter Problem
Date: Fri, 18 Jul 2003 11:19:46 -0400
Lines: 40
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: <3f1811af@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1058541999 24.128.134.183 (18 Jul 2003 08:26:39 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!205.215.62.125.MISMATCH!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail