<< Click to Display Table of Contents >>
ZfxSendMsg
Submit message to fax server for sending.
Syntax
ZFERR FAR ZfxSendMsg( ZFSESSIONHANDLE hSession, char FAR *lpszBody, char FAR *lpszDataExtn, char FAR *lpszComment)
Parameters
Parameter |
Description |
hSession |
API session handle, as returned by ZfxAPIInit call |
lpszBody |
Body name of control file and data filelpszDataExtnExtension of data file corresponding to the data format |
lpszComment |
Descriptive comment (of maximum length ZFMSG_COMMENT_LENGTH). This is the comment that appears on the Zetafax client display OUT directory list. |
Description
This routine makes an entry for a new message in the user's OUT directory INFO file then sends a message to the Zetafax server asking it to queue the message for sending.
The caller should first create two files in the users OUT directory (as given by the ZfxGetUserOutDir function). These are the control file (with extension ".CTL"), and the data file (with an extension corresponding to the data file format, as specified in File System Structure section above. The two files should have the same body name, which will usually have been determined by calling the ZfxCreateAutoFileroutine.
Note that once a message has been submitted to the fax server for processing, the server will periodically open the control file to change the status lines or append message history and status information to the file. It is recommended that application programs avoid opening the control file until the status of the message changes to ZFMSG_OK or ZFMSG_FAILED, at which point the server has completed processing of the message. However, if the program requires to read the file during this time then it must not be kept open for more than 2 seconds, otherwise status updates may be lost.
NOTE - this function is supplied for compatibility with version 5 of the Zetafax API only. Version 6 API applications should use ZfxSendMsgEx .
Return value
The routine returns 0 if successful, otherwise one of the following:
ZFERR_NOT_INITIALISED
ZFERR_INVALID_PARAMETERS
ZFERR_SERVER_NOT_RUNNING
ZFERR_FILE_NOT_FOUND
ZFERR_MESSAGE_ALREADY_EXISTS
ZFERR_INFO_FILE_OPEN_ERROR
ZFERR_INFO_FILE_ERROR
ZFERR_INFO_FILE_INVALID
ZFERR_CANNOT_SUBMIT_REQUEST
Example
#include <stdio.h>
#include <zfapi.h>
...
/* create ~XSND000.CTL and ~XSND000.TXT */
...
if (ZfxSendMsg(hSession, "~XSND000", "TXT", "To: Sam Smith") == 0)
{
printf("Submitted to Zetafax server\n");}
else
{
/* delete the two files */
...
}
Related topics