(Page 16 of 40 in this chapter)


vceGetHighMessageNumber

Description

Gets the highest message number in an open voice object.

Prototype

DWORD vceGetHighMessageNumber ( VCEHD vh,
unsigned *highmsg)

vh Handle of an open voice object.

highmsg Pointer to the returned message number.

Return Values

Events

Details

This function returns the message number of the highest numbered non-empty message in the voice object specified by vh. The returned message number will be VCE_UNDEFINED_MESSAGE if there are no messages in the voice object.

The highest message returned is not necessarily an indication of how many messages exist in a voice object. To count the number of actual messages, call vceGetMessageSize for each message number from zero (0) to highmsg inclusive, and sum the messages that have non-zero size.

This function is useful for determining the next message number to use (1 more than highmsg) for a voice mail system where the messages must be maintained in chronological order even if deleted messages have left gaps in the message numbers.

vceGetHighMessageNumber does not affect the current message.

See Also

vceGetMessageSize, vceGetUniqueMessageNumber

Example


/* Count messages in a voice file */

unsigned myMessageCount (VCEHD vh)
{
unsigned highmsg;
unsigned message;
unsigned msgsize;
unsigned count = 0;

vceGetHighMessageNumber (vh, &highmsg);
if (highmsg == VCE_UNDEFINED_MESSAGE)
return 0 ;

for (message=0; message <= highmsg; message++)
{
vceGetMessageSize (vh, message, &msgsize);
if (msgsize != 0)
++ count;
}
return count;
}


(Page 16 of 40 in this chapter)


tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights reserved.