- 积分
- 1296
- 明经币
- 个
- 注册时间
- 2006-7-5
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
在执行打印任务,保存plt文件的代码中,pPlotProgDlg->setPlotMsgString(AcPlPlotProgressDialog::kDialogTitle,_T("lot API Progress"));这行代码时即报错,,不知啥原因,急求高手指点啊。(注:代码中标红部分即为开始报错的地方)
Acad::ErrorStatus es;
es = m_pPSV->setPlotType(m_pPlotSettings, AcDbPlotSettings::kExtents);
//设置缩放比例
es = m_pPSV->setUseStandardScale(m_pPlotSettings, Adesk::kFalse);
es = m_pPSV->setCustomPrintScale(m_pPlotSettings, 1, 1);
es = m_pPSV->setPlotCentered(m_pPlotSettings, true);
es = m_pPSV->setPlotCfgName(m_pPlotSettings,m_strDevice);
m_pPSV->refreshLists(m_pPlotSettings);
AcPlPlotEngine* pEngine = NULL;
if(Acad::eOk == AcPlPlotFactory::createPublishEngine(pEngine))
{
// 打印进度对话框
AcPlPlotProgressDialog *pPlotProgDlg = acplCreatePlotProgressDialog(acedGetAcadFrame()->m_hWnd,false,1);
AfxMessageBox("打印进度对话框开始...");
pPlotProgDlg->setPlotMsgString(AcPlPlotProgressDialog::kDialogTitle,_T("lot API Progress"));
pPlotProgDlg->setPlotMsgString(AcPlPlotProgressDialog::kCancelJobBtnMsg,_T("Cancel Job"));
pPlotProgDlg->setPlotMsgString(AcPlPlotProgressDialog::kCancelSheetBtnMsg,_T("Cancel Sheet"));
pPlotProgDlg->setPlotMsgString(AcPlPlotProgressDialog::kSheetSetProgressCaption,_T("Job Progress"));
pPlotProgDlg->setPlotMsgString(AcPlPlotProgressDialog::kSheetProgressCaption,_T("Sheet Progress"));
pPlotProgDlg->setPlotProgressRange(0,100);
pPlotProgDlg->onBeginPlot();
pPlotProgDlg->setIsVisible(true);
es = pEngine->beginPlot(pPlotProgDlg);
AcPlPlotPageInfo pageInfo;
AcPlPlotInfo plotInfo;
// 设置布局
plotInfo.setLayout(m_layoutId);
// 重置参数
plotInfo.setOverrideSettings(m_pPlotSettings);
AcPlPlotInfoValidator validator;
validator.setMediaMatchingPolicy(AcPlPlotInfoValidator::kMatchEnabled);
es = validator.validate(plotInfo);
// 开始打印
const TCHAR *szDocName = acDocManager->curDocument()->fileName();
es = pEngine->beginDocument(plotInfo, szDocName, NULL, 1, true, m_strPath);
// 给打印机和进度对话框发送消息
pPlotProgDlg->onBeginSheet();
pPlotProgDlg->setSheetProgressRange(0, 100);
pPlotProgDlg->setSheetProgressPos(0);
es = pEngine->beginPage(pageInfo, plotInfo, true);
es = pEngine->beginGenerateGraphics();
es = pEngine->endGenerateGraphics();
es = pEngine->endPage();
pPlotProgDlg->setSheetProgressPos(100);
pPlotProgDlg->onEndSheet();
pPlotProgDlg->setPlotProgressPos(100);
es = pEngine->endDocument();
es = pEngine->endPlot();
pEngine->destroy();
pEngine = NULL;
pPlotProgDlg->destroy();
}
else
{
acedAlert(_T("打印失败!"));
}
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|