Problem with CPrintDialog

I want to ask the printer-configuration without displaying the printer-configuration-dialogbox, so I programmed:

CPrintDialog printDialog(FALSE);

If I debug this codeline in VC++5.0 I always get a hwnd=0x0000. Does anybody knows, what's the cause for it ?

Thanks
LVL 1
atariAsked:
Who is Participating?
 
tflaiConnect With a Mentor Commented:
FALSE == 0
CPrintDialog printDialog(0) == CPrintDialog w/ parent window handle 0.
Try "printDialog(this)".
0
 
atariAuthor Commented:
Why can I nevertheless ask for the printer-configuration by programming:

CPrintDialog PrintDialog(FALSE);
PrintDialog.GetDefaults();  ???

Why does it work, also if I don't use '(this)' ???


0
 
tflaiCommented:
Then you should use CPrintDialog's constructor instead of CDialog's constructure:
CPrintDialog(BOOL bPrintSetupOnly, DWORD dwFlags, CWnd* pParentWnd);

0
 
atariAuthor Commented:
Thanks a lot !

atari
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.