Link to home
Start Free TrialLog in
Avatar of mlazear
mlazearFlag for United States of America

asked on

Customizing a Print Dialog via PrintDlgEx in C++

I need to customize a Print Dialog via PrintDlgEX in C++ (no MFC, no .NET).

I currently support printing from a PrintDlg dialog that is not customized.

PrintDlgEX dialogs add fields I don't want to see (Page Range and Collate for example).  I also want to add a couple of fields that are unique to my application as well as adding Portrait and Landscape onto the dialog similar to the PrintDlg.
I've found the definition of PrintDlgEx:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646942(v=vs.85).aspx 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646844(v=vs.85).aspx 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646896(v=vs.85).aspx

What I know so far:
I have code working that will bring up the PrintDlgEX dialog.

I understand I have to create an instance of a callback class that implements the IPrintDialogCallback interface and connect it to lpCallback field.  This class needs to define HandleMessage, InitDone and SelectionChange methods.

I understanding I need to create a dialog in my .rsc file that defines the lower portion of the print dialog. This has to be linked to the lpPrintTemplateName.   I’ve found the PrnSetup.dlg file that has the default fields for this dialog.

What I'm after:
The absolute perfect solution would be to find a C++ example/sample app of the PrintDlgEX that shows a customized version of the dialog.  You would think Microsoft would have this somewhere but I haven't found it with quite a bit of searching.  I’m not looking for anything fancy, just enough to show how everything is connected.

If no sample is available any good books, documentation or sites that would explain the overall process and what needs to go in the callback functions would be helpful.

Any help is appreciated.

Mike
ASKER CERTIFIED SOLUTION
Avatar of mlazear
mlazear
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mlazear

ASKER

My answer doesn't really deserve an A but since I'm providing answers for my own question I'm not going to give me a low grade.
Avatar of Ron Francis
Ron Francis

Did you ever get it working?
I'm trying to do the same thing and finding very little information as to how to go about it anywhere.
I have what I thought should work, but whenever I access my custom controls, I get often get random unhandled exceptions.
It's driving me crazy.

Anyway, I'm hoping you're still around and can shed some light on how you implemented it.