🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Printer properties

#7835
From: Thomas J.
Date: Thu, 16 Dec 2004 14:52
68 lines
3232 bytes
Thanks a lot. The first exmaple with the  page setup is working, but not the
second. No dialog is shown.

Tom

"Keith" <kdopson@sbcglobal.net> schrieb im Newsbeitrag
news:41C19B3E.7A34D7BA@sbcglobal.net...
>
>
> "Thomas J." wrote:
>
> > 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);
> >     }
> >
>
> There are a few things missing from your example:
>
> LPPAGESETUPDLG pageSetup;
> pageSetup=new PAGESETUPDLG;      // create a new structure
> ZeroMemory(pageSetup,sizeof(PAGESETUPDLG)); // clear it out
> pageSetup->lStructSize=sizeof(PAGESETUPDLG); // set the structure size
> pageSetup->hwndOwner=Handle;  // and owner handle
>
>     bool result = PageSetupDlg(pageSetup);
>     if (result) {
>         MessageDlg("Ok", mtInformation, TMsgDlgButtons() << mbOK, 0);
>     } else {
>         MessageDlg("Error", mtError, TMsgDlgButtons() << mbOK, 0);
>     }
> delete pageSetup;   // delete it when you are through using it.
>
>     PRINTDLG printerSetup;
> ZeroMemory(&printerSetup,sizeof(PRINTDLG)); // clear out this local
structure
> variable
> printerSetup.lStructSize=sizeof(PRINTDLG); // set the structure length
> printerSetup.hwndOwner=Handle; // and owner handle
>
>     result = PrintDlg(&printerSetup);
>     if (result) {
>         MessageDlg("Ok", mtInformation, TMsgDlgButtons() << mbOK, 0);
>     } else {
>         MessageDlg("Error", mtError, TMsgDlgButtons() << mbOK, 0);
>     }
>
>
> keith
>
>
Technical Details
Message-ID: <41c1a15b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!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
References: <41bfe84c$1@newsgroups.borland.com> <6ro0s0pgsjn6kr7lnhkb68gtfkr2g0glm2@4ax.com> <41c162f7@newsgroups.borland.com> <41C19B3E.7A34D7BA@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>
Subject: Re: Printer properties
Date: Thu, 16 Dec 2004 15:52:30 +0100
Lines: 70
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: <41c1a15b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1103208795 217.78.136.170 (16 Dec 2004 06:53:15 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!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