FaxMan SDK Version 4.7
Monitoring Fax Status

Monitoring Fax Status through the FaxStatus Event

The FaxStatus event allows your application to keep track of each stage of a fax’s sending or receiving progress (we’ll ignore the receiving status events until a little later). FaxStatus events are fired throughout the send process, from the time the faxmodem is first initialized, through dialing and fax transmission, to the moment a faxmodem is shutdown after sending. At each relevant step along the way, your application will receive a FaxStatus event.


If you look in the reference section at the FaxStatus event, you’ll see that it’s defined as having a Device parameter and a Status parameter (we’ll ignore the control array index for this discussion). The Device parameter gives an index into the device array that can be used to reference all of the StatusXxx properties (such as StatusConnectSpeed, Status, etc...); using these properties your app can obtain detailed information about the fax that is being referenced. The Status parameter is an integer which specifies which point in the faxing procedure this fax has reached; this value corresponds to the string returned by the Status property, thus allowing your application to take specific action at a particular point in the fax procedure without having to match strings to determine where things stand. This example should give you an idea how to use the Device and Status parameters:


‘We assume that your control is named FaxMan1

Sub FaxMan1_FaxStatus(Index as Integer, Device as Integer, Status as Integer)

 'Wait for the faxmodem to begin dialing, then print

 ' a message containing the phone number we’re dialing

 If Status = 5 Then

  Print "We’re dialing:" & StatusNumber(Device)

 End If

End Sub


Here’s a list of the StatusXxx properties that can be referenced during the FaxStatus event. These properties really have no meaning outside of a FaxStatus event:



















Of particular interest is the StatusPercentage property. During fax transmission, this property indicates how much of the currently sending fax has been sent, so it can be used quite easily to display a percentage bar or something similar for each page of the fax. (Note that the percentage is totally irrelevant during fax reception, as there’s no way to tell how long the incoming fax will be, thus no way to calculate a percentage).



© 2013 Data Techniques, Inc. All Rights Reserved.

Send comments on this topic.