以下是我的一段打印小程序:
/* 第一段程序没错,因怀疑和fail有关,故拷贝 */
         pDC->SetMapMode(MM_LOENGLISH);
nWidth = pDC->GetDeviceCaps(HORZRES);
nHeight = pDC->GetDeviceCaps(VERTRES);
DEVMODE *dm = pInfo->m_pPD->GetDevMode();
ratio = dm->dmPrintQuality / 100;
nWidth = (int)nWidth / ratio;
nHeight = (int)nHeight / ratio;
pDC->SetWindowOrg(0,nHeight); DOCINFO di;
::ZeroMemory(&di,sizeof(DOCINFO));
di.cbSize = sizeof(DOCINFO);
if (pDC->StartDoc(&di)==-1) {
MessageBox("StartDoc error");
return;
}运行时pDC->StartDoc(&di)出错.其实第二段程序是我从VC++6.0可运行程序拷贝过来的.很简单,怎么出错呢?