🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: can't start print dialog box

#13348
From: Bob Gonder
Date: Fri, 17 Oct 2003 00:50
23 lines
1749 bytes
Richard Yu wrote:

>    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 .

Look at the documentation for PrintDlg() [noEx]
It says to use CommDlgExtendedError() if the result isn't S_OK.
That would be your first step, see what the OS says is wrong.

>    pd1.hwndOwner = GetDesktopWindow();
Check that this isn't 0. I think it might be.
You should use the hWnd of your app.
Technical Details
Message-ID: <voeuovocs799sbshscq988u43g9d0jd88t@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f8f1905$1@newsgroups.borland.com> <3f8f1c4f$1@newsgroups.borland.com> <3f8f2eb2@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 18:09:18 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: can't start print dialog box
Date: Thu, 16 Oct 2003 17:50:48 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <voeuovocs799sbshscq988u43g9d0jd88t@4ax.com>
References: <3f8f1905$1@newsgroups.borland.com> <3f8f1c4f$1@newsgroups.borland.com> <3f8f2eb2@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.31.164.70
X-Trace: newsgroups.borland.com 1066351849 67.31.164.70 (16 Oct 2003 17:50:49 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail