Please enable JavaScript to view this site.

Raster Image Printer

Navigation: Raster Image Printer Advanced Concepts

Signaling Events Using Run Commands

Scroll Prev Top Next More

Both the Run Commands, Success and Failure, can be used to identify events for the driver to signal.

This is useful for signaling to your own application when the conversion is complete, or when it failed. The driver only opens and signals the events. It is your responsibility to create and block on the events in your own code.

Signaling the Event

Events are specified using the syntax {EventName}, with Eventname the event that you want to signal. When a run command is an event name, the parameters and start in folder information is ignored.

SignlaEventsSuccessRunCommand

Sample C++ Code

Below is a code snippet showing the creation of the event and how to wait for the driver to signal the event before continuing the processing of the file.

DWORD dwWait = WAIT_TIMEOUT;
 
// Create the event
m_hEvent = ::CreateEvent( NULL, FALSE, FALSE, _T("Global\\JobSuccess") );
 
if ( m_hEvent == NULL ) {
   ::AfxMessageBox( _T("Failed to create the event") );
   return ;
}
 
// do some other coding here, such as printing the document
// wait for event, 2 min 
dwWait = ::WaitForSingleObject( this->m_hEvent, 120000 );
 
if ( WAIT_OBJECT_0 == dwWait ) {
   ::AfxMessageBox( _T("Success on event signal") );
 
   // do something with the complete file here such as 
   // uploading to an FTP site or an in-house archive system
}
else if ( WAIT_TIMEOUT == dwWait ){
   ::AfxMessageBox( _T("TIMEOUT on event signal") );
}
else {
   ::AfxMessageBox( _T("FAIL on event signal") );
}