阅读:1583回复:1
wince 打印问题
下面这段代码在VC下测试通过,到EVC下编译后,在ce5.0下,能够弹出打印机对话框,但是确定后,就没有反应了,不知道为什么?希望大家能帮忙解决
CPrintDialog dlg(FALSE); if (dlg.DoModal() == IDOK) { CDC dc; dc.Attach(dlg.GetPrinterDC()); //HDC hdc = CreateDC(_T("MYPRINT"), dlg.GetDeviceName, // dlg.GetPortName, ) CString strTitle; strTitle.LoadString(AFX_IDS_APP_TITLE); DOCINFO di; ::ZeroMemory(&di, sizeof(DOCINFO)); di.cbSize = sizeof(DOCINFO); di.lpszDocName = strTitle; BOOL bPrintingOK = dc.StartDoc(&di); CPrintInfo info; info.m_rectDraw.SetRect(0, 0, dc.GetDeviceCaps(HORZRES), dc.GetDeviceCaps(VERTRES)); OnBeginPrinting(&dc, &info); //for (UINT page = info.GetMinPage(); // page <= info.GetMaxPage() && bPrintingOK; // page ++) UINT page = 1; { dc.StartPage(); info.m_nCurPage = page; OnPrint(&dc, &info); bPrintingOK = (dc.EndPage() > 0); } OnEndPrinting(&dc, &info); //if (bPrintingOK) { dc.EndDoc(); } //else dc.AbortDoc(); dc.DeleteDC(); } |
|
沙发#
发布于:2008-10-09 17:07
可能是"dlg.DoModal() == IDOK "这句不成立
|
|