Capture Events by 2 printjobs simultaneously

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
mvanroshum
Posts: 3
Joined: Mon Sep 24 2007

Capture Events by 2 printjobs simultaneously

Post by mvanroshum » Mon Feb 07 2011

Hi,

In our application, I use CaptureEvents(1) together with including BroadCastMessages in the FileNameOptions to be able to monitor when the printing starts (StartDocPost) and when printing ends (EndDocPost).
From EndDocPost, I call CaptureEvents(0) to stop te events.
However, now I have the following issue.
Suppose an end-user starts printing a large document and starts a second printjob before the first printjob has ended.
Then the events should IMHO occur in (for example) the following order:
StartDocPost (printjob 1)
StartDocPost(printjob 2)
EndDocPost(printjob 1)
EndDocPost(printjob 2)

However, it seems that it doesn't work this way. The problem is that the the configurationcode for printjob 2 calls CaptureEvents(1).
From that moment, all events only will be received by printjob 2.

The FileNameOptions has BroadCastMessages set to true, but am I correct that the printerdriver uses a unicast broadcast model
(e.g., only one subscriber can be active at a time, opposed to a multicast model where multiple subscribers would be able to receive the events)

So, is there any feature I can use to make this work?
Or should I rely on handcrafted solutions (like using a Mutex to make sure that only one printjob is active at a time?)

Thanks in advance
Marco

Post Reply