I have an MFC app that has a Dialog containing the Microsoft WebBrowser control.
Once I have navigated to the appropriate URL, I wish to initiate a 'Print' however, I wish to change the target printer programmatically beforehand and set it back afterwards.
I loacated some source on Microsoft's MSDN for a function called 'GetPrinterDevice' that returns the appropriate hDevMode and hDevNames to the required printer; see
I therefore have the following:
HGLOBAL hDevMode = NULL;
HGLOBAL hDevNames = NULL;
inter"), &hDevNames, &hDevMode))
R = 2;
const IDM_PRINT = 6;
, hDevMode); // Default to MyPrinter
R, 0, 0);
AfxMessageBox(_T("Failed to select 'MyPrinter'."));
If I misspell the required printer, the AfxMessageBox pops up, so the function appears to be <almost> working, however, ExecWB still prints to the normal Windows Default printer!!!
Can anyone tell me where I'm going wrong???