.
description.
description .
Followin link has error descriptions. i am looking for an API function to
retrieve the error description.
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
Had you considered something as simple as looking in winerror.h? Where
317 says
ERROR_MR_MID_NOT_FOUND
The system cannot find message text...
which is not terribly surprising because 0x80040103 is not a specified
error code.
First: what API returned this error code? If MS does not have a string
for the error code
they return from a known API, then this represents a bug. But without
knowing what API
returned the error code it is impossible to tell what went wrong.
What version of VS are you using? What version of Windows? It helps to
know. At least
the VS2005 SDK does not list 0x80040103 as a known error code, and the
Error Lookup tool
of VS (see Tools>Error lookup) on Vista claims it is an unknown error.
Second: the only correct way to handle this is as shown in my example of
using
FormatMessage in MFC, where you have to report the error code as a
decimal
and hexadecimal
number; that is, you have to write
if(::FormatMessage(...) == 0)
{
CString fmt;
fmt.LoadString(IDS_UNKNOWN_ERROR);
// Unknown error code %d (0x%08x)
CString t;
t.Format(fmt, err, err);
...deal with returning t as the error string
}
joe
On Thu, 21 Feb 2008 03:45:25 -0600, "slg" <slg@abc.com> wrote:
I am using format message as follows. This function is in a mfc dll.
when
i
pass err value as
0x80040103 which is BadCharWidth it fails and last error is 317
LPTSTR s;
::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
err,
0,
(LPTSTR)&s,
0,
NULL)
DWORD dwlastError = GetLastError();
dwLastError value is 317.
can any one explain what does 317 mean?
TIA
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm