<< Click to Display Table of Contents >>
ZfxVBSendSubmitFile
Send a single SUBMIT format file.
Syntax
ZFERR FAR ZfxVBSendSubmitFile( char FAR *lpszUsername, char FAR *lpszSubmitFile, char FAR *lpszPrefix)
Parameters
Parameter |
Description |
lpszUserName |
Zetafax username to use for submitting the message |
lpszSubmitFile |
Full path and file name of SUBMIT format file to send. |
lpszPrefix |
4 characters string giving the prefix to use when creating the control and data files. |
Description
This routine interprets the given SUBMIT format file, creating a CONTROL file and a DATA file (in ASCII text or Epson print format). It then calls the ZfxSendMsgEx function to submit these files for sending.
This is equivalent to calling ZfxAPIInit, ZfxSendSubmitFile and ZfxAPIClosedown. It is supplied for programs that can call functions in the DLL, but are unable to store the session handle returned by ZfxAPIInit and pass it to the other two functions - word processor macro languages and some Visual Basic applications, for example.
The ZfxAPIInit function has to do a certain amount of work to determine the system configuration and user settings, so it is more efficient when submitting multiple faxes to keep a session open (calling ZfxAPIInit once when the application starts for example) then repeatedly call ZfxSendSubmitFile. It is therefore recommended that this function is only used by programs that are unable to use ZfxSendSubmitFile .
Return value
The routine returns 0 if successful, otherwise one of the following:
ZFERR_INVALID_PARAMETERS
ZFERR_NO_ZF_INIT_FILE
ZFERR_INVALID_ZF_INIT_FILE
ZFERR_UNKNOWN_USER
ZFERR_CANNOT_LOG_ON
ZFERR_FILE_OPEN_ERROR
ZFERR_FILE_ERROR ZFERR_SERVER_NOT_RUNNING
ZFERR_SUBMIT_FILE_INVALID
ZFERR_INFO_FILE_OPEN_ERROR
ZFERR_INFO_FILE_ERROR
ZFERR_INFO_FILE_INVALID
ZFERR_CANNOT_SUBMIT_REQUEST
Example
#include <stdio.h>
#include <zfapi.h>
...
if ((fp = fopen("XYZ.TMP", "w+b")) != NULL)
{
fputs("%%[MESSAGE]\r\n", fp);
fputs("From: Fred Smith\r\n", fp);
fputs("To: Jim Jones\r\n", fp);
fputs("Fax: 123 456 7890\r\n", fp);
fputs("%%[TEXT]\r\n", fp);
fputs("Hello Jim\r\n", fp);
fclose(fp);
Err = ZfxVBSendSubmitFile("FRED", "XYZ.TMP", "XSUB");
remove("XYZ.TMP");
if (Err == 0)
{
printf("Submitted message\n");
}
}
Related topics