# cbGetErrMsg()

Returns the error message associated with an error code. Each function returns an error code. An error code that is not equal to 0 indicates that an error occurred. Call this function to convert the returned error code to a descriptive error message.

## Function Prototype

C/C++

int cbGetErrMsg(int ErrCode, char ErrMsg[ERRSTRLEN])

Visual Basic

Function cbGetErrMsg(ByVal ErrCode&, ByVal ErrMsg$) As Long

## Arguments

ErrCode

The error code that is returned by any function in library.

ErrMsg

The error message is returned here. The ErrMsg variable must be pre-allocated to be at least as large as ERRSTRLEN. This size is guaranteed to be large enough to hold the longest error message.

## Returns

- Error code or 0 if no errors
- ErrMsg - error message string is returned here

## Note

- See also cbErrHandling() for an alternate method of handling errors.