Registering for Event Notifications

A fax client that uses the extended Component Object Model (COM) client model can register for server events. Server events include notification of changes to the fax server configuration, incoming and outgoing job queues and archives, and activity. You can register for notifications sent by the fax server for various server events. A fax client can filter for events for which it requires notification. Notifications are implemented using a connection point interface. For more information about connection point interfaces, see Connection Points.

Pre-Windows Vista

To receive the notifications, use the IFaxServer::ListenToServerEvents method. This method receives values from the FAX_SERVER_EVENTS_TYPE_ENUM enumeration. Use the values to specify the events for which you want to register.

After you register for events, implement the corresponding event handler functions of IFaxServerNotify. When the event occurs, the event handler will be called, and your code in the event handler function will run.

If you do not want the server to receive notifications, call IFaxServer::ListenToServerEvents using the value fsetNONE. In this case, the server will not call your event handler function.

For example, if you want to register to be notified when a new job is added to either the incoming or outgoing queue, you would first call FaxServer.ListenToServerEvents(fsetIN_QUEUE | fsetOUT_QUEUE). You would then implement the FaxServerNotify.OnIncomingJobAdded and FaxServerNotify.OnOutgoingJobAdded methods. When an incoming or outgoing job is added to the queue, your code will run so that you can handle the event.

For an example Microsoft Visual Basic program that registers for event notifications, see Registering for Fax Events. For more information about registering for events in Visual Basic, see Handling an Object's Events.

Windows Vista

In Windows Vista, fax account notifications can be received using IFaxAccount::ListenToAccountEvents method. This method receives values from the FAX_ACCOUNT_EVENTS_TYPE_ENUM enumeration. Use the values to specify the events for which you want to register.

After you register for events, implement the corresponding event handler functions of IFaxAccountNotify. When the event occurs, the event handler will be called, and your code in the event handler function will run.

If you do not want to receive the account notifications, call IFaxAccount::ListenToAccountEvents using the value faetNONE. In this case, your event handler function will not be called.