FaxMan SDK Version 4.7
FAXSENDMSG Message

FAXSENDMSG Message

 

lParam PSEND_FAX points to a SEND_FAX structure containing the up to date information regarding this fax.

 

The FAXSENDMSG is sent to your application during fax send/receive events to keep your app informed of a fax’s progress. By subscribing to this message stream, your application can easily display the progress of every fax sent and received. Each time the FAXSENDMSG is sent, the underlying SEND_FAX structure will have changed to reflect the new status of the fax. The easiest way to follow the progress of a fax is to follow the SEND_FAX’s fs member, which reflects the current FAXSTATE. The following code shows how this is done:

 

 PSEND_FAX pFax;

 

 pFax = (PSEND_FAX)lParam;

  switch (pFax->fs) {

 

  case FAXST_ANSWERING:

   break;

 

  case FAXST_RX_NEGOTIATE:

   break;

 

  case FAXST_RXDATA:

   break;

 

 // you can include case statements for all of the faxstates

 // you wish to track...

 ...

 

The next question you might ask is "Sure, it gives me the status events, but how do I know what has changed at each event, and what order can I expect them to come in?" Well, the following table should give you some better idea what’s happening with each status event (these entries correspond to the FAXSTATUS enumeration defined in FAXDLL.H):

 

Sending Status Event

It’s Meaning

FAXST_INIT

FaxMan is initializing the sending structures. Can be ignored

FAXST_SEND_INIT

The faxmodem is being initialized. If an error occurs at this stage, the faxmodem is probably not responding at all. It is probably a good idea to present a dialog to your users asking them to verify that the faxmodem is turned on and working properly.

FAXST_SEND_DIALING

The phone is off-hook and dialing.

FAXST_SEND_WAIT_FCON

Dialing is completed and we’re waiting for a response from the remote faxmodem.

FAXST_SEND_FCSI

We’re connected to the remote fax and have received its ID string. At this point, the szRemoteID field is filled in with the remote fax’s ID string.

FAXST_SEND_FDCS

We’ve successfully negotiated with the remote fax machine and have established this session’s parameters. The fields dwSpeed and nFaxRes now reflect the values for this fax session

FAXST_SENDING

We are now actually transmitting the fax data

FAXST_PAGE_END

We have completed sending a page of data. At this point, depending on whether there

are more pages to be sent, we will receive either FAXST_COMPLETE or return to FAXST_SENDING.

FAXST_COMPLETE

The fax has been completed

FAXST_PORTSHUT

The faxmodem has been freed and all activity for this fax is now finished. The comm port is not released until this notification is received. You should also check the FAXERROR member, fe, to determine whether the fax went through successfully or not. If it did not, the nHangCode member will generally indicate what happened.

Receive Status Event

 

FAXST_INITRX

The faxmodem is being initialized for receiving a fax. Until the FAXST_ANSWERING notification is received the faxmodem has not yet received a call. If there is an error at this point, the faxmodem is probably not responding at all, and the end-user should be instructed to make sure the faxmodem is turned on and is installed properly, etc...

FAXST_WAITFORRX

The faxmodem was initialized successfully and is now waiting patiently for a call.

FAXST_ANSWERING

The faxmodem is now receiving a call.

FAXST_RX_NEGOTIATE

The faxmodem has successfully negotiated the session parameters. The dwSpeed and nSendRes structure members are now valid, as is the szRemoteID string.

FAXST_RXDATA

We’re receiving page data from the remote fax.

FAXST_RX_PAGE_END

We’ve completed page data reception. At this point we may return to the FAXST_RXDATA stage or we may continue to the FAXST_COMPLETE stage, depending on whether there are more pages to be sent.

FAXST_COMPLETE

We’re done with the receive session

FAXST_PORTSHUT

We’ve now closed the faxmodem and freed the comm port. You should check the FAXERROR member, fe, to determine if the fax was successful. If it was now, the nHangCode member will probably indicate why it was not.

 

This should give you what you need to put together your fax monitoring code.

 

 


© 2013 Data Techniques, Inc. All Rights Reserved.

Send comments on this topic.