G
Guest
Hi all,
I have to recompile a MFC++ Program developped under NT4.0 in XP. We store
the printer settings (DEVMODE and DEVNAMES) as part of our document. When
printing in batch mode, we need to create a PrintingContext without asking
the user. Here is my code fragment (I removed all error handling):
BOOL CTsprintView::OnPreparePrinting(CPrintInfo* pInfo) {
// we get DEVMODE and DEVNAMES from the document...
....
pDoc->setContext(pInfo);
// now pInfo->m_pPD->m_pd.hDevMode and
// pInfo->m_pPD->m_pd.hDevNames are set.
// now we create the context:
pInfo->m_pPD->CreatePrinterDC();
return true;
}
when starting the program as above, nothing gets printed. (And I see no
error messages). When I change the last line to
pInfo->m_pPD->DoModal();
the dialog gets popped up correcty with the right settings and printing
works as expected.
Any hints/help is welcome.
Thanks
Jürg
I have to recompile a MFC++ Program developped under NT4.0 in XP. We store
the printer settings (DEVMODE and DEVNAMES) as part of our document. When
printing in batch mode, we need to create a PrintingContext without asking
the user. Here is my code fragment (I removed all error handling):
BOOL CTsprintView::OnPreparePrinting(CPrintInfo* pInfo) {
// we get DEVMODE and DEVNAMES from the document...
....
pDoc->setContext(pInfo);
// now pInfo->m_pPD->m_pd.hDevMode and
// pInfo->m_pPD->m_pd.hDevNames are set.
// now we create the context:
pInfo->m_pPD->CreatePrinterDC();
return true;
}
when starting the program as above, nothing gets printed. (And I see no
error messages). When I change the last line to
pInfo->m_pPD->DoModal();
the dialog gets popped up correcty with the right settings and printing
works as expected.
Any hints/help is welcome.
Thanks
Jürg