怎么什么也打不出来?
HDC hdcPrn ;
CPrintDialog *printDlg =
new CPrintDialog(FALSE, PD_ALLPAGES | PD_RETURNDC, NULL); printDlg->m_pd.nMinPage = printDlg->m_pd.nMaxPage = 1;
printDlg->m_pd.nFromPage = printDlg->m_pd.nToPage = 1;
printDlg->DoModal();
hdcPrn = printDlg->GetPrinterDC();
if (hdcPrn != NULL)
{
CDC *pDC = new CDC;
pDC->Attach (hdcPrn); // attach a printer DC
pDC->StartDoc("test"); // begin a new print job
// CDC::StartDoc(LPDOCINFO) override
// pDC->StartPage(); // begin a new page
m_List.Print(pDC,PRF_CHECKVISIBLE); // pDC->TextOut(10, 10, "aaa");// write the string in pbuf
// pDC->EndPage(); // end a page
pDC->EndDoc(); // end a print job
pDC->Detach(); // detach the printer DC
delete pDC; }
delete printDlg;
HDC hdcPrn ;
CPrintDialog *printDlg =
new CPrintDialog(FALSE, PD_ALLPAGES | PD_RETURNDC, NULL); printDlg->m_pd.nMinPage = printDlg->m_pd.nMaxPage = 1;
printDlg->m_pd.nFromPage = printDlg->m_pd.nToPage = 1;
printDlg->DoModal();
hdcPrn = printDlg->GetPrinterDC();
if (hdcPrn != NULL)
{
CDC *pDC = new CDC;
pDC->Attach (hdcPrn); // attach a printer DC
pDC->StartDoc("test"); // begin a new print job
// CDC::StartDoc(LPDOCINFO) override
// pDC->StartPage(); // begin a new page
m_List.Print(pDC,PRF_CHECKVISIBLE); // pDC->TextOut(10, 10, "aaa");// write the string in pbuf
// pDC->EndPage(); // end a page
pDC->EndDoc(); // end a print job
pDC->Detach(); // detach the printer DC
delete pDC; }
delete printDlg;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货