Article View: borland.public.cppbuilder.nativeapi
Article #7833Re: Printer properties
From: Thomas J.
Date: Thu, 16 Dec 2004 10:26
Date: Thu, 16 Dec 2004 10:26
52 lines
2683 bytes
2683 bytes
Oh sorry I used to work with the VCL. It would be great if you could send me
a code snippet how to open the dialog.
My code snippet is not working. Thanks for your help
LPPAGESETUPDLG pageSetup;
bool result = PageSetupDlg(pageSetup);
if (result) {
MessageDlg("Ok", mtInformation, TMsgDlgButtons() << mbOK, 0);
} else {
MessageDlg("Error", mtError, TMsgDlgButtons() << mbOK, 0);
}
PRINTDLG printerSetup;
result = PrintDlg(&printerSetup);
if (result) {
MessageDlg("Ok", mtInformation, TMsgDlgButtons() << mbOK, 0);
} else {
MessageDlg("Error", mtError, TMsgDlgButtons() << mbOK, 0);
}
"Bob Gonder" <notbg@notmindspring.invalid> schrieb im Newsbeitrag
news:6ro0s0pgsjn6kr7lnhkb68gtfkr2g0glm2@4ax.com...
> Thomas J. wrote:
>
> >How can I get the ACTUAL printer properties.
> >For example:
> >I start my application read the properties like width and height of a
page
> >and the values are fine.
> >If I now change the printer setting via printer setup of windows like
width
> >and height and read again the properties of the printer I get still the
old
> >properties.
>
> 1)
> Do you leave the printer open or do you ClosePrinter() ?
> Do you check the return value from DocumentProperties() for errors?
>
>
> 2)
> Don't do that (use external windows printer setup).
> Instead, do it from your program with PrintDlg() with the
> PD_PRINTSETUP flag.
> PrintDlg() returns the settings in the DEVMODE.
>
> It might be if you ask Windows for a new DEVMODE that it will go back
> to the original values, so keep and use the one returned from PrintDlg
>
>
Technical Details
Message-ID:
<41c162f7@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41bfe84c$1@newsgroups.borland.com> <6ro0s0pgsjn6kr7lnhkb68gtfkr2g0glm2@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6620db7697e43cb9 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Thomas J." <monathomas@12move.de> Newsgroups: borland.public.cppbuilder.nativeapi References: <41bfe84c$1@newsgroups.borland.com> <6ro0s0pgsjn6kr7lnhkb68gtfkr2g0glm2@4ax.com> Subject: Re: Printer properties Date: Thu, 16 Dec 2004 11:26:18 +0100 Lines: 54 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 217.78.136.170 Message-ID: <41c162f7@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103192823 217.78.136.170 (16 Dec 2004 02:27:03 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail