Article View: borland.public.cppbuilder.nativeapi
Article #7838Re: Printer properties
From: Thomas J.
Date: Thu, 16 Dec 2004 15:35
Date: Thu, 16 Dec 2004 15:35
52 lines
2643 bytes
2643 bytes
Mad, I copied your code which you posted and I'm using Windows2000, BCB6
Enterpise.
This is the code which is running not proper on my system. I get directly
the error message (the second MessageDlg("Error", ...)
PRINTDLG printerSetup;
ZeroMemory(&printerSetup, sizeof(PRINTDLG)); // clear out this local
structure
printerSetup.lStructSize = sizeof(PRINTDLG); // set the structure length
printerSetup.hwndOwner = Handle; // and owner handle
bool result = PrintDlg(&printerSetup);
if (result) {
MessageDlg("Ok", mtInformation, TMsgDlgButtons() << mbOK, 0);
} else {
MessageDlg("Error", mtError, TMsgDlgButtons() << mbOK, 0);
}
"Keith" <kdopson@sbcglobal.net> schrieb im Newsbeitrag
news:41C1A8C1.45910074@sbcglobal.net...
>
>
> "Thomas J." wrote:
>
> > Thanks a lot. The first exmaple with the page setup is working, but not
the
> > second. No dialog is shown.
>
> From MSDN:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/commondialogboxlibrary/commondialogboxreference/commondialogboxfunctions/printdlg.asp
>
> TinyURL: http://tinyurl.com/4rbwk
>
> In your first dialog, you were using a pointer to a PAGESETUPDLG
structure,
> hence PageSetupDlg(pageSetup).
>
> In your second dialog, you are using a local PRINTDLG structure. So be
sure you
> have the & operator in front of printerSetup in the call
> result = PrintDlg(&printerSetup);
>
> I checked the code I provided using BCB 5 Enterprise on Win98SE and both
dialogs
> are presented.
>
> keith
>
>
Technical Details
Message-ID:
<41c1ab73$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!proxad.net!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<41bfe84c$1@newsgroups.borland.com> <6ro0s0pgsjn6kr7lnhkb68gtfkr2g0glm2@4ax.com> <41c162f7@newsgroups.borland.com> <41C19B3E.7A34D7BA@sbcglobal.net> <41c1a15b$1@newsgroups.borland.com> <41C1A8C1.45910074@sbcglobal.net>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> <41c162f7@newsgroups.borland.com> <41C19B3E.7A34D7BA@sbcglobal.net> <41c1a15b$1@newsgroups.borland.com> <41C1A8C1.45910074@sbcglobal.net> Subject: Re: Printer properties Date: Thu, 16 Dec 2004 16:35:35 +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: <41c1ab73$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103211379 217.78.136.170 (16 Dec 2004 07:36:19 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!proxad.net!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail