Re: FormatMessage and WSAGetLastError
- From: r_z_aret@xxxxxxxxxxxx
- Date: Thu, 18 Dec 2008 14:53:46 -0500
On Thu, 18 Dec 2008 08:53:01 -0800, Fabio Sobral
<FabioSobral@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi.
I'm having a problem with FormatMessage and error codes from WSAGetLastError.
I tested the same code in a WM5 and a WM6 device, and FormatMessage failed
on both. Using GetLastError after FormatMessage I get 317 - "The system
cannot find message text for message number 0x%1 in the message file for %2."
Older versions of Windows CE provided _no_ messages, so FormatMessage
was useless and error 317 was common.
Can I really use FormatMessage with error codes that are not from
GetLastError?
If so, what would be the problem?
I'm doing something like this:
void getErrorMessage(int errorCode, TCHAR* buffer, int32 size)
{
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_IGNORE_INSERTS,
null, errorCode, 0, buffer, size, null));
}
If everything is fine, maybe the devices lack this part of the system
message-table. What can I do in this case?
I build a generic message that gives the error number and says no
further info is available. I also include info I gather (e.g., that my
program was trying to open a file called blah).
Thanks
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 400
Boston, MA 02116
www.penfact.com
.
- Follow-Ups:
- Re: FormatMessage and WSAGetLastError
- From: Fabio Sobral
- Re: FormatMessage and WSAGetLastError
- References:
- FormatMessage and WSAGetLastError
- From: Fabio Sobral
- FormatMessage and WSAGetLastError
- Prev by Date: FormatMessage and WSAGetLastError
- Next by Date: Re: FormatMessage and WSAGetLastError
- Previous by thread: FormatMessage and WSAGetLastError
- Next by thread: Re: FormatMessage and WSAGetLastError
- Index(es):
Relevant Pages
|
Loading