Article View: borland.public.cppbuilder.nativeapi
Article #13345Re: can't start print dialog box
From: Richard Yu
Date: Thu, 16 Oct 2003 23:49
Date: Thu, 16 Oct 2003 23:49
42 lines
2150 bytes
2150 bytes
my setting like this,
still no dlg shown up,
HRESULT hResult1;
PRINTDLGEX pd1;
memset(&pd1, 0, sizeof(pd1));
pd1.lStructSize = sizeof(PRINTDLGEX);
pd1.hwndOwner = GetDesktopWindow();
pd1.hDevMode=NULL;
pd1.hDevNames=NULL;
pd1.Flags = PD_RETURNDC ;
pd1.nCopies=1;
pd1.nStartPage = START_PAGE_GENERAL;
hResult1 = PrintDlgEx(&pd1);
the hResult1 is not S_OK .
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message
news:3f8f1c4f$1@newsgroups.borland.com...
>
> "Richard Yu" <richard@colorselector.com> wrote in message
> news:3f8f1905$1@newsgroups.borland.com...
> > I use the following code, why I can't start the print dialog box in C++?
>
> Probably because you did not initialize the PRINTDLGEX structure first.
You
> need to set the structure's lStructSize member to the size of the
structure
> before calling PrintDlgEx(). Depending on your actual needs for the
dialog,
> you may need to fill in other members of the structure as well, such as
> hwndOwner, Flags, ExclusionFlags, nPageRanges, lpPageRanges, etc.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<3f8f2eb2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-05!sn-xit-08!supernews.com!newsfeeds.sol.net!skynet.be!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f8f1905$1@newsgroups.borland.com> <3f8f1c4f$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,517b17f45791657 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-10-16 17:12:42 PST From: "Richard Yu" <richard@colorselector.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f8f1905$1@newsgroups.borland.com> <3f8f1c4f$1@newsgroups.borland.com> Subject: Re: can't start print dialog box Date: Thu, 16 Oct 2003 16:49:14 -0700 Lines: 44 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 24.207.7.224 Message-ID: <3f8f2eb2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1066348210 24.207.7.224 (16 Oct 2003 16:50:10 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-05!sn-xit-08!supernews.com!newsfeeds.sol.net!skynet.be!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail