1

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.

2 Answers 2

2

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

1
  • Thank you, I think that does it. I had searched the web for this but didn't find that particular article.
    – djeidot
    Oct 14, 2009 at 16:03
1

Perhaps this might prove a bit helpful

1
  • This helps setting the default printer, which is not quite what I intended, but it can be useful to others.
    – djeidot
    Oct 14, 2009 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.