特急,300分(300分)

  • 主题发起人 主题发起人 775533
  • 开始时间 开始时间
7

775533

Unregistered / Unconfirmed
GUEST, unregistred user!
有谁能给我一个使用FindNextPrinterChangeNotification函数的例子.<br>我已经为他搞了两个星期啦.谢谢,谢谢<br>我用VB6使用这个函数编译通过
 
http://groups.google.com/groups?hl=en&amp;threadm=3ba7b4d0_1%40dnews&amp;rnum=1&amp;prev=/groups%3Fhl%3Den%26q%3DFindNextPrinterChangeNotification%26btnG%3DGoogle%2BSearch%26meta%3Dgroup%253Dborland.public.delphi.*
 
用www.google.com就找得到.
 
自已搜索一下吧.
 
第二个参数dwchange是不是一个cardinal类型,我编译时提示类型不一致
 
procedure PrinterJ;<br>var<br>&nbsp; LHandle:THandle;<br>&nbsp; LInt,LIntA:Integer;<br>&nbsp; LCardinal,LCardinalA:Cardinal;<br>&nbsp; LLPDWORDA,LLPDWORDB:Cardinal;<br>&nbsp; LPHandle:THandle;<br>&nbsp; LAA,LCC: PRINTER_NOTIFY_OPTIONS;<br>&nbsp; LBB: PRINTER_NOTIFY_INFO;<br>&nbsp; LDD:PRINTER_NOTIFY_OPTIONS_TYPE;<br>begin<br>If OpenPrinter(PCHAR(FPName),LHandle,nil) = True Then<br>&nbsp; Begin<br>&nbsp; &nbsp; LPHandle:= FindFirstPrinterChangeNotification(LHandle,PRINTER_CHANGE_JOB, 0, nil);<br>&nbsp; &nbsp; If LPHandle = &nbsp;INVALID_HANDLE_VALUE Then<br>&nbsp; &nbsp; &nbsp; Begin<br>&nbsp; &nbsp; &nbsp; &nbsp; ShowMessage('进行打印机监视失败!');<br>&nbsp; &nbsp; &nbsp; End<br>&nbsp; &nbsp; Else<br>&nbsp; &nbsp; &nbsp; Begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;While IsAddDoc = False Do<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LCardinal := WaitForSingleObject(LPHandle, INFINITE);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If LCardinal = WAIT_OBJECT_0 Then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LAA.Version := 2;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LAA.Flags := PRINTER_NOTIFY_OPTIONS_REFRESH;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LDD.wType := JOB_NOTIFY_TYPE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LAA.pTypes := @LDD;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FindNextPrinterChangeNotification(LPHandle,LCardinalA,@LAA,LBB);?????<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Else<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Begin<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End;<br>&nbsp; &nbsp; &nbsp; End;<br>&nbsp; End<br>Else<br>&nbsp; Begin<br>&nbsp; &nbsp; ShowMessage('打开打印机失败!');<br>&nbsp; End;<br>end;<br><br>?????处提示:<br>&nbsp; [Error]...:Types of actual and formal var parameters must be identical<br>我是在一个线程中使用
 
www.playicq.com
 
添加<br>var<br>&nbsp; pLBB:PPrinterNotifyInfo;<br><br>pLBB:=@LBB;<br>FindNextPrinterChangeNotification(LPHandle,LCardinalA,@LAA,Pointer(pLBB));
 
Pipi<br>我按照你讲的作了,不对,还是一样的
 
Pipi,对不起,你的是对的.我已经使用通过了<br>但是,还想问一个问题,为什么我获得的JOB的页数都是0
 
后退
顶部