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 necessari开发者_如何学Pythonly 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.
Another article from Microsoft's KB: How to programmatically print to a non-default printer in MFC
Perhaps this might prove a bit helpful
精彩评论