Getting the last error description

int sol_GetError( HGREN hEngine, wchar_t * Buffer, int BufferLen )

int sol_GetError8( HGREN hEngine, char * Buffer, int BufferLen )

Parameters:

hEngine - grammatical dictionary instance handle.

Buffer - output buffer for error message.

BufferLen - output buffer length including terminating 0.

Return value:

0 - error indicator is empty.

1 - error message has been successfully copied to output buffer.

Remarks

Output buffer length must be passed as number of wchar_t for sol_GetError and number of bytes for sol_GetError8. Use sol_GetErrorlen and sol_GetErrorLen8 respectfully to get this length.

Error message is truncated if output buffer length is not enough to store the whole string.

In multithreaded environment, it is possible that new error occurs between sol_GetErrorLen and sol_GetError calls making it difficult to get the error message without truncation.

C++ sample code:

#include "solarix_grammar_engine.h"

int l = sol_GetErrorLen8(hEngine);
char *err = new char[ l ];
sol_GetError8( hEngine, err, l );
// ...
delete[] err;

Navigation

Purchase the Grammatical Dictionary SDK

Russian version of this page

error_api.cpp

Back to API functions list

  © Козиев Илья 2019
last change 04-Apr-11