CanGetErrorString


Function

Retrieves the error string from the error code.

Format

Ret = CanGetErrorString ( ErrorCode , ErrorString )

Parameters

ErrorCode [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ]
Specify the return value of each function.

ErrorString [ VB.NET: StringBuilder ] [ C, C++: char * ] [ C#: out string ]
Specify the base address of the buffer to store the error string. The maximum length of the string is 256 characters.

Return Value

Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ]

Definition

Value
[Dec]

Description

CAN_ERR_SUCCESS

0

Normality completion

CAN_ERR_DLL_BUFF_ADDRESS

10100

Invalid data buffer address.

The others (See also: Details of Error Code)

Initial Value

None

Remarks

It is an utility function that returns the meaningful string for the error code. Please use this function for the error processing.

Example

Stores the description of error code 10000 to ErrorString.

VB.NET

Dim Ret As Integer
Dim ErrorString As New StringBuilder("", 256)
Ret = CanGetErrorString ( 10000 , ErrorString )
 

C, C++

long Ret;
char ErrorString[256];
Ret = CanGetErrorString ( 10000 , ErrorString );
 

C#

int Ret;
string ErrorString;
Ret = can.GetErrorString ( 10000 , out ErrorString );
 

See Also

None