Table of Contents Index NMS Glossary Previous Page Next Page (Page 17 of 41 in this chapter) Version


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;
}


Table of Contents Index NMS Glossary Previous Page Next Page (Page 17 of 41 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, Natural MicroSystems, Inc. All rights reserved.