vceGetCurrentSize

Returns the size of the current message.

Prototype

DWORD vceGetCurrentSize ( CTAHD ctahd, unsigned *actualsize)

Argument

Description

ctahd

Handle returned by ctaCreateContext or ctaAttachContext.

actualsize

Pointer to the returned size, in milliseconds, of the current message.


Return values

Return value

Description

SUCCESS

 

CTAERR_INVALID_CTAHD

Context handle is invalid.

CTAERR_SVR_COMM

Server communication error.

VCEERR_NO_MESSAGE

No current message is in the context.


Details

vceGetCurrentSize returns the size, in milliseconds, of the current message for the context that ctahd specifies. If the current message is a list, this function returns the total size of all messages in the list.

Use vceGetContextInfo to retrieve the current position in the current message.

Example

/* delete current message if smaller than threshold */
extern CTAHD Ctahd;

void myDeleteSmallMessage (unsigned minseconds)
{
    unsigned actualsize;      /* size in milliseconds */

    vceGetCurrentSize (Ctahd, &actualsize) ;
    if (actualsize < minseconds * 1000)
    {
        /* Use vceErase to erase the current message */
        vceSetPosition (Ctahd, 0, VCE_SEEK_SET, NULL) ;
        vceErase (Ctahd, actualsize, NULL);
    }
}