Last revised: 16-01-2009.
Starts a monitoring session. See Remarks for details.
object.StartMonitoring()
The StartMonitoring syntax has these parts:
| Part | Description |
|---|---|
| object | Required. An object expression that evaluates to a QueueMonDLL.Application object. |
StartMonitoring has no return values.
StartMonitoring does not return until monitoring stops. This means that any application code that call the StartMonitoring method will NOT progress beyond the line that calls the StartMonitoring method until monitoring has stopped.
However, executing the StartMonitoring method will NOT block the User Interface of your application (i.e. it still allow your application to receive standard Windows Messages and therefore still allow events such as Click events to be in effect).
When StartMonitoring is called it will raise a OnMonitoringStarted event. As soon as this event is fired it will enter a »sleeping« state that waits for printer notifications from Windows.
If Windows has no printers instances installed that uses the »Publi PDF« printer driver, the StartMonitoring method will assume an error occurred and fire the OnMonitoringStopped event immediately. Hence, in this case all queue monitoring is stopped immediately because Publi PDF has nothing to do.
If proper Windows print queues exists Publi PDF will examine the Attended property for each and compare it with the Publi PDF RunMode property. If not at least one match is found, the StartMonitoring method will assume an error occurred and fire the OnMonitoringStopped event immediately. Hence, in this case all queue monitoring is stopped immediately because Publi PDF has nothing to do.
For an example, see A complete, but simple Publi PDF monitor.