FAXCOMEXLib – Failure to Retrieve Status Events (C#) – Problem and Solution

Problem

Registering one FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM event at a time works, however creating a fax service does not raise FaxJobStatus events correctly – has trouble retrieving the fax status.

Solution

1. FAXCOMEXLib and Windows Fax Server Version

Issues with FAXCOMEXLib might actually relate to the Windows fax server version you are working with. For more details, see our page on FAXCOMEXLib fax server version support.

2. Check Return Value of FaxServer.ListenToServerEvents

There might be a problem with hooking handlers or something similar. If the return value of FaxServer.ListenToServerEvents is successful, this means registration is OK and there is a different problem.

3. Make Sure Individual Events are Registered with | and Not +

Make sure that the individual events are registered with | (or) and not a + (add).

Correct code example:

objFaxServer.ListenToServerEvents fsetFXSSVC_ENDED | fsetOUT_QUEUE

Incorrect code example:

objFaxServer.ListenToServerEvents fsetFXSSVC_ENDED + fsetOUT_QUEUE

4. Make Sure your Code Waits

Make sure your code includes a ‘wait’ construct like the .NET ManualResetEvent.

For the full discussion regarding this issue on the PCreview forum, click here.