Notification of File Saved without RegisterWindowMessage

Post here any questions/suggestions you have about novaPDF SDK or novaPDF OEM.
DanCooperstock
Posts: 5
Joined: Tue Dec 07, 2010 2:41 pm
Location: Toronto Canada
Contact:

Notification of File Saved without RegisterWindowMessage

Postby DanCooperstock » Fri Sep 12, 2014 4:17 pm

I'm converting an app using the novaPDF SDK to one that cannot receive arbitrary events. Currently I'm using RegisterWindowMessage to register the events, and RegisterEventWindow to specify the window to receive the events, in my app that CAN receive arbitrary events.

Is there some other way to do this, to at least know when a print is done (or has an error, and if so, which error), for programming environments that can't handle arbitrary events?

I see in your Help the functions RegisterNovaEvent and WaitForNovaEvent. Can they be used to replace the code that I can no longer use? Something I don't understand with WaitForNovaEvent is how to tell which event was completed when it returns, and how to code it to be sure to catch all events. If that will work for me, could you point me at a code sample that uses it to handle multiple events (like page ended and file saved). (Or can you not get page ended events when you use RegisterNovaEvent, unlike when you use RegisterWindowMessage?)

Thanks.

Softland
Posts: 163
Joined: Wed Dec 16, 2009 10:48 am
Location: Cluj-Napoca, Romania
Contact:

Re: Notification of File Saved without RegisterWindowMessage

Postby Softland » Mon Sep 15, 2014 1:56 pm

The only way to receive multiple events is with the windows messages (using RegisterEventWindow / RegisterWindowMessage). The RegisterNovaEvent and WaitForNovaEvent cand be used with only one event. The usage is like this:

Just before starting a print job, you have to inform novaPDF printer that you want to wait for an event. Call:

pNova.RegisterNovaEvent("NOVAPDF_EVENT_FILE_SAVED")

Immediately after you send the job to the printer call:

pNova.WaitForNovaEvent(nMiliseconds, bTimeout)

This function will return when the event was signaled or when the time was elapsed. If the time was elapsed bTimeout is TRUE and if the event was signaled, bTimeout is FALSE.

There can be used one of these strings for events:
"NOVAPDF_EVENT_START_DOC"
"NOVAPDF_EVENT_END_DOC"
"NOVAPDF_EVENT_FILE_SAVED"

The events can be used only to wait in your application until the PDF is started or finished by the printer, but you cannot get an error code or information about print progress.

DanCooperstock
Posts: 5
Joined: Tue Dec 07, 2010 2:41 pm
Location: Toronto Canada
Contact:

Re: Notification of File Saved without RegisterWindowMessage

Postby DanCooperstock » Mon Sep 15, 2014 3:55 pm

So I take it that if it times out there is no way to find out what the problem was. That doesn't seem like it would be adequate for our purposes.


Return to “Developer Tools”