LBase::SetErrorString

#include "ltwrappr.h"

static L_VOID LBase::SetErrorString (nErrorCode, pszNewErrString, pszOldErrString=NULL, uSizeOldErrStrBuff=0)

L_INT nErrorCode;

/* a LEADTOOLS error code */

L_TCHAR * pszNewErrString;

/* pointer to the new error string */

L_TCHAR * pszOldErrString;

/* pointer to an optional buffer that will be updated with the old error string */

L_UINT uSizeOldErrStrBuff;

/*the size of the old error string buffer */

Changes the error string for one of the LEADTOOLS error codes.

Parameter

Description

nErrorCode

One of the LEADTOOLS error codes.

pszNewErrString

Pointer to a buffer that contains the new error string for the specified error code. The string must not exceed 256 characters, including the terminating NULL. The contents of this buffer will be copied, and you should free this buffer when you are finished with it.

pszOldErrString

Pointer to an optional buffer that will be updated with the old error string for the specified error code. The string must not exceed 256 characters, including the terminating NULL. You must allocate the memory for this buffer and free it when you are finished with it.

uSizeOldErrStrBuff

Size of the pszOldErrString passed buffer. This parameter is ignored if pszOldErrString is NULL.

Returns

None

Comments

Call this function to change the error string for one of the LEADTOOLS error codes. This will change the internal error string for the specified error code. When displaying the string for this error code, the new string will be used.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64.

See Also

Functions:

LBase::EnableAutoErrorDisplay, LBase::GetErrorString, LBase::DisplayErrorFromList, LBase::DisplayError, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::SetErrorListDepth, LBase::RecordError, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorList, Class Members

Example

L_INT LBase__SetErrorStringExample()
{
	
	LBase Base;
	
	Base.SetErrorString(WRPERR_BITMAP_NOT_ALLOCATED, TEXT("UserMessage - Bitmap not allocated."));
	Base.DisplayError(NULL, WRPERR_BITMAP_NOT_ALLOCATED);
	return SUCCESS;
}