I’m on Windows and trying to print an Enhanced Metafile (EMF) using PlayEnhMetaFile().
I’m currently displaying it using a device context for a window on the screen, but now I want to send it to a printer.
How can I get a device context for the printer and pass it into this function properly?
The easiest way is to use construct the device context from
PRINTDLG.hDevModeandPRINTDLG.hDevNamesafter callingPrintDlgif using win32 API, or callingCPrintDialog::GetPrinterDCif you’re using MFC.If using MFC:
or win32 API: