tags:

views:

131

answers:

2

I want to print a customized report to a specific printer, bypassing the print dialog. The printer is to be selected by the user for each report template.

Right now I have the code to print the report showing the print dialog, or directly to the default printer. I need to change it in order to print directly to a printer which is not necessarily the default one.

I realize that calling SetDefaultPrinter before printing is an easy solution, but it's not thread-safe.

Note: I'm using C++/MFC.

+1  A: 

Perhaps this might prove a bit helpful

Adrian
This helps setting the default printer, which is not quite what I intended, but it can be useful to others.
djeidot
+1  A: 

Another article from Microsoft's KB: How to programmatically print to a non-default printer in MFC

Nick D
Thank you, I think that does it. I had searched the web for this but didn't find that particular article.
djeidot