<< Click to Display Table of Contents >>

 

zetafax_logo

ZfxDeleteMsg

 


 

Delete message entry.

 

Syntax

 

ZFERR FAR ZfxDeleteMsg( ZFSESSIONHANDLE hSession, ZFMSGDIR MsgDir, char FAR  *lpszBody, short fDeleteFiles)

 

Parameters

 

 

Parameter

Description

hSession

API session handle, as returned by ZfxAPI

Init call MsgDir

Message type - ZFDIR_OUT for sent messages, or ZFDIR_IN for  received messages

lpszBody

Message body name - NULL to delete all messages for this user fDeleteFilesBoolean, non-zero if the control and data files (and any other  temporary files created by the server) for the message are to be deleted, in addition to removing the message entry from the INFO file.

 

 

Description

 

This routine is called to remove the entry for a given message from the OUT or  IN directory message INFO file, and optionally to delete the associated data  files. If the server is stopped and the body name is specified as NULL then  this routine will reset the specified directory (and its subdirectories) to  delete all entries from the queue. Note that if the fDeleteFiles flag is set in  this case all files will be deleted from the OUT directory and its  subdirectories or the Z-IN directory, and a new empty INFO file generated.

 

Return value

 

The routine returns 0 if successful, otherwise one of the following:  

ZFERR_NOT_INITIALISED

ZFERR_INVALID_PARAMETERS

ZFERR_SERVER_NOT_RUNNING

ZFERR_UNKNOWN_MESSAGE

ZFERR_INFO_FILE_OPEN_ERROR

ZFERR_INFO_FILE_ERROR

ZFERR_INFO_FILE_INVALID

ZFERR_MESSAGE_NOT_COMPLETED

ZFERR_SERVER_RUNNING

 

Example

 

#include  <stdio.h>

#include <zfapi.h>

...

 

/* following call fails if message status not */

/* ZFMSG_FAILED or ZFMSG_OK */

if (ZfxDeleteMsg(hSession, ZFDIR_OUT, "~XSND000",  TRUE) == 0)

{

  printf("Message deleted\n");

}

 

Related topics

Alphabetical reference

Function error returns and reference