Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FindFirstPrinterChangeNotification

Status
Not open for further replies.

formerTexan

Programmer
Joined
Apr 10, 2004
Messages
504
Location
US
I would like to verify that a report (MS Access in this case) has actually printed. This is in a setting with Windows XP on a Novell network.

So far I have been unable to raise a valid event handle from FindFirstPrinterChangeNotification although I have tried it both with and without a pointer to a PRINTER_NOTIFY_OPTIONS structure. The function is being passed a valid printer handle.

Code:
Public Declare Function apiFindFirstPrinterChangeNotificationLong Lib "winspool.drv" Alias "FindFirstPrinterChangeNotification" _
  (ByVal hPrinter As Long, ByVal fdwFlags As Long, ByVal fdwOptions As Long, ByVal lpPrinterNotifyOptions As Long) As Long

Public Sub WaitForPrinterEvent(ByVal hPrinter As Long)

'Call InitialiseNotifyOptions    '\\ initialize structures
'mEventHandle = apiFindFirstPrinterChangeNotificationLong(hPrinter, PRINTER_CHANGE_JOB, 0, varPtr(PrintOptions))   '\\ ptr to PRINTER_NOTIFY_OPTIONS structure

mEventHandle = apiFindFirstPrinterChangeNotificationLong(hPrinter, PRINTER_CHANGE_JOB, 0, 0)

If mEventHandle <> INVALID_HANDLE_VALUE Then
'do stuff here...
End If

End Sub

Is this an insurmountable network issue? Should I consider an alternative approach? Any suggestions on how to register a printer event will be welcome.

Thanks,
Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top