Re: FormatMessage and WSAGetLastError
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Thu, 18 Dec 2008 13:21:53 -0700
The device OEM using Windows CE can build the messages DLL into the system,
or not. It sounds like whatever you're using does not have it. Perhaps
with older tools, it was copied when you were debugging a program or
something, which got it on your device, but maybe that doesn't happen any
more.
Paul T.
"Fabio Sobral" <FabioSobral@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:70CAA838-781D-4119-9725-BBE0CC088647@xxxxxxxxxxxxxxxx
What bugs me about it is that I remember seeing these messages before.
Maybe
it was a specific device that I no longer have here, but I'm almost sure
it
worked before.
I understand ripping off of the system message-table stuff that are
unlikely
or impossible to happen, but removing the WSA messages from a WM6 device
with
GPRS and Wifi seems too lame to be true.
I sure hope I'm doing something wrong, because returning the error code
and
asking the user to check the winerror list to find out it's meaning is
sad.
"r_z_aret@xxxxxxxxxxxx" wrote:
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
.
- References:
- FormatMessage and WSAGetLastError
- From: Fabio Sobral
- Re: FormatMessage and WSAGetLastError
- From: r_z_aret
- Re: FormatMessage and WSAGetLastError
- From: Fabio Sobral
- FormatMessage and WSAGetLastError
- Prev by Date: Re: FormatMessage and WSAGetLastError
- Next by Date: How to refresh or remove metadata files
- Previous by thread: Re: FormatMessage and WSAGetLastError
- Next by thread: How to refresh or remove metadata files
- Index(es):
Relevant Pages
|
Loading