I'm developing an MFC application using VS2010.
I noticed that the the printing in my application stopped to work.
So the releveant piece of code is here:
CPrintDialog PrintDlg(FALSE, PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_NOSELECTION | PD_DISABLEPRINTTOFILE, this);
if(PrintDlg.DoModal() == IDOK)
When PrintDlg.DoModal() is executed it comes up with this message:
"Before you can perform printer-releted tasks such as page setup or printing a document, you need to install a printer. Do you want to install a printer now?"
When I press the 'Yes' button it comes with another error:
"Windows can't open Add Printer. The local print spooler service is not running. Please restart the spooler or restart the machine"
I have network printer installed as default, and I can print from any other application without a problem.
I'm using Windows 7, but I checked on Windows XP and it comes with the same error.
I tried to swap the above code with:
CPageSetupDialog psd(PSD_INTHOUSANDTHSOFINCHES | PSD_MARGINS | PSD_ENABLEPAGEPAINTHOOK, this);
if(psd.DoModal() == IDOK)
but it does the same thing.
The Print Spooler service is running. Also I tried to create dummy app with just the piece of code above and it still comes with the same message.