我正在更新我们的“打印机监控”应用程序。以前该应用程序可以在 Windows 2000 服务器上成功运行。现在我们转向 Windows 7 服务器。在 Windows 7 上,我们的“打印监视器”应用程序崩溃。当我调试它时,我发现我们的 SetJob
函数抛出以下异常:
The parameter is incorrect.
有人知道这件事吗?
函数调用:
SetJob(
mhPrinter,
midJob,
0,
IntPtr.Zero,
PrintJobControlCommands.JOB_CONTROL_PAUSE) 'Here exception is thrown
我们使用的Spooler API:
<DllImport("winspool.drv", EntryPoint:="SetJob", _
SetLastError:=True, CharSet:=CharSet.Ansi, _
ExactSpelling:=False, _
CallingConvention:=CallingConvention.StdCall)> _
Public Function SetJob _
(<InAttribute()> ByVal hPrinter As IntPtr, _
<InAttribute()> ByVal dwJobId As Int32, _
<InAttribute()> ByVal Level As Int32, _
<InAttribute()> ByVal lpJob As IntPtr, _
<InAttribute(), MarshalAs(UnmanagedType.U4)> ByVal dwCommand As PrintJobControlCommands _
) As Boolean
最佳答案
关于vb.net - Windows 打印机后台处理程序 setjob 功能不适用于 Windows-7?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6176977/