myelan
驱动牛犊
驱动牛犊
  • 注册日期2002-08-08
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1256回复:0

请教:为什么在取消打印作业的时候,报权限不足的错误呢?

楼主#
更多 发布于:2005-03-31 13:25
if (OpenPrinter(pPrintInfo.pPrinterName, &hNewPrinter, &pAccessMode) && IsPrinterHandle ( hNewPrinter ))
这样打开打印机,
hPrinterNotification = FindFirstPrinterChangeNotification(
ThreadParam.hPrinter, /* The printer of interest */
        PRINTER_CHANGE_DELETE_JOB, /* We need to know when a job is removed */
        0, /* reserved */
        &NotificationOptions); /* The details of what notifications that are needed */
用FindFirstPrinterChangeNotification获取消息之后,
用setjob准备取消打印任务的时候,报错“权限不足”
if (SetJob(ThreadParam.hPrinter,0,0,NULL,JOB_CONTROL_DELETE))
MessageBox( NULL, \"success\", \"info\", MB_OK );
else
ErrorBox(GetLastError(), \"PRINTER_CHANGE_SET_JOB\");

请各位帮帮忙,谢谢
足球是我的一部分
游客

返回顶部