Returns the list of messages contained in the current message.
DWORD vceGetCurrentList ( CTAHD ctahd, VCE_MESSAGE *msglist[], unsigned maxcount, unsigned *actualcount)
|
Argument |
Description |
|
ctahd |
Handle returned by ctaCreateContext or ctaAttachContext. |
|
msglist |
Pointer to an array of the VCE_MESSAGE structure: typedef struct Refer to the Details section for a description of these fields. |
|
maxcount |
Number of elements in the msglist array. |
|
actualcount |
Pointer to returned number of elements written to the msglist array. |
|
Return value |
Description |
|
SUCCESS |
|
|
CTAERR_INVALID_CTAHD |
Context handle is invalid. |
|
CTAERR_SVR_COMM |
Server communication error. |
vceGetCurrentList returns the list of messages contained in the current message for the context that ctahd specifies. When vcePlayList or vceSetCurrentList defines the current message, it can contain a list of messages.
The VCE_MESSAGE structure contains the following fields:
|
Field |
Description |
|
vh |
Handle of an open voice object. |
|
message |
Message number in the voice object that vh specifies. |
The number of messages in the list is returned in actualcount unless actualcount is NULL. If there is no current message, the function returns SUCCESS and zero (0) in actualcount. If maxcount is less than or equal to the actual list size, the function returns SUCCESS and maxcount in actualcount.
To retrieve the list size of the current message, use vceGetContextInfo.
Applications accessing the same voice object using ctaAttachHandle in a shared context environment are returned separate handles. The Voice Message service internally records the handle (vh) of the application that opened or created the voice object.
/*Return the current message (or first message if current message is a list*/
void myGetCurrentMessage (CTAHD ctahd, VCEHD *vh, unsigned *message)
{
VCE_MESSAGE vcemsg;
unsigned actual;
vceGetCurrentList (ctahd, &vcemsg, 1, &actual);
if (actual == 0)
{
*message = VCE_UNDEFINED_MESSAGE;
*vh = 0;
}
else
{
*vh = vcemsg.vh;
*message = vcemsg.message;
}
}