(Page 20 of 80 in this chapter)


adiGetErrorText

Description

Returns the text representation of an error code.

Prototype

DWORD adiGetErrorText( DWORD errcode,
char *text,
unsigned size )

errcode AG Access error code.

text Buffer to receive description.

size Size (bytes) of buffer to receive description.

Return Values

Events

None.

Details

adiGetErrorText returns a NULL-terminated text string in text that corresponds to the AG Access error in errcode. Refer to Appendix A for a list of AG Access errors. Pass a buffer size of at least 40 bytes. If size is too small to contain the entire description, (size - 1) bytes will be copied, followed by a NULL termination.

See Also

adiGetEventText, adiSetErrorHandler

Example


DWORD myFetchAndProcess( unsigned drvid, ADI_EVENT *event )
{
    char      errortext[40];
    char      eventtext[40];
    DWORD     ret;

    ret = adiFetchAndProcess( drvid, event );
    if( ret != SUCCESS )
    {
        adiGetErrorText( ret, errortext, sizeof errortext );
        printf( "adiFetchAndProcess failed: %s.\n", errortext );
    }
    else if( event->value != 0 )
    {
        adiGetEventText( event->id, eventtext, sizeof eventtext );

        if ( IS_ADI_DONE( event->id ) && IS_ADI_ERROR( event->value ) )
        {
            adiGetErrorText( event->value, errortext, sizeof errortext );
            printf( "%s, error=%s (%08X)\n", eventtext, errortext, ret );
        }
        else
            printf( "%s\n", eventtext );
    }
    return ret;
}


(Page 20 of 80 in this chapter)


Tech_Support@nmss.com
Copyright © 1996, Natural MicroSystems, Inc. All rights reserved.