CHtmlEditCtrl - Overriding printer dialog and use with modeless dialogs
-
Reference: http://stackoverflow.com/questions/8982965/printing-in-mfc-application[^] Question #1: I have a Dialog based app using sample code taken above. App runs fine. I want to avoid having the popup printer selection window appear once the print job is started (i.e. when PrintDocument() is called). I just want to print to the default printer. How can I do this? Issue #2: This dialog app itself creates numerous other new dialog windows depending on user's selection. There is a need to have many of the features provided by this dialog application implemented as command line features. What did I do? ... Upon app started, I created a modeless dialog object with the intent not to display the dialog (unless absolutely necessary). Some of the dialog methods do function. The method that handles the printing does not work. The code fragment that causes a problem is CBatchResultsDlg::WaitForComplete() - because of AfxPumpMessage(). The owner of the CHtmlEditCtrl object is the Desktop window because setting the dialog window creating the object as owner fails. How can I fix this such that my printing will work.