In the following example, the formatted error message is obtained for the errorcode.
void PrintErrorMessage(int errorcode)
{
if(NULL == ErrMsg.EM.pWC)
{
printf("\nMem Alloc failed for DPEM_WC_SS\n");
return;
}
ErrMsg.EM.
pWC->
pMsg = &ErrMsgText[0];
if(ODPPSUCCESS != retVal1)
{
printf("\nFunc Provider_GetFmtErrMsgEarly failed, rc = %d\n", retVal1);
goto OnError;
}
#ifdef _PRINTF_LS
printf("Error Message Source:%ls\n",ErrMsgSrc);
printf("Error Message Text: %ls \n",ErrMsgText);
printf("Error Message Body: \n %ls\n",ErrMsgBody);
#else
printf("Error Message Source:%ws\n",ErrMsgSrc);
printf("Error Message Text: %ws \n",ErrMsgText);
printf("Error Message Body: \n%ws\n",ErrMsgBody);
#endif
OnError:
return;
}