Controlling notifications and queries

 

When an action occurs through the user interface or through a few API commands, Imagenation can send an advise to the client application. A C API advise request can either be placed globally on all Imagenation entities, or be assigned to specific document objects. When the requested event occurs, the related callback function that receives the advise data is called.

The C API uses two types of advises--notifications and queries. With notifications, Imagenation posts a message to the client library, and it comes through during an idle time. The client library then calls the appropriate callback function. With queries, Imagenation must wait until the client returns a response to the query to know what action to take.

To set up various advises, you must declare and define the related callback function, then register the advise with the IN_RegisterNotify or the IN_RegisterQuery function. Generally, the notification or query is registered globally for all Imagenation entities.

In UNIX integrations, the client library will check if any notifications or queries are waiting to be processed before it sends a command to Imagenation. If your application has idle periods, then we recommend calling the IN_ProcessAdvise function. This function checks if any notifications or queries are pending. Any found are then processed.

In both Windows and UNIX, when you are finished with an advise, you must unregister it by using the IN_UnregisterNotify or the IN_UnregisterQuery function. Most client applications register all the required advises after starting Imagenation, and then leave these advises registered until the end of the entire session.

For a full list of notify and query identifiers and their related callback functions, see:

image\bltlrgsq_shg.gif Notifications

image\bltlrgsq_shg.gif Queries

See also

Interpreting C error messages

Using the C API: Overview