Re: FormatMessage and WSAGetLastError



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



.



Relevant Pages

  • Re: FormatMessage and WSAGetLastError
    ... I'm having a problem with FormatMessage and error codes from WSAGetLastError. ... void getErrorMessage(int errorCode, TCHAR* buffer, int32 size) ...
    (microsoft.public.windowsce.app.development)
  • Re: FormatMessage and WSAGetLastError
    ... I'm having a problem with FormatMessage and error codes from WSAGetLastError. ... I tested the same code in a WM5 and a WM6 device, ... void getErrorMessage(int errorCode, TCHAR* buffer, int32 size) ...
    (microsoft.public.windowsce.app.development)
  • FormatMessage and WSAGetLastError
    ... I'm having a problem with FormatMessage and error codes from WSAGetLastError. ... I tested the same code in a WM5 and a WM6 device, ... void getErrorMessage(int errorCode, TCHAR* buffer, int32 size) ...
    (microsoft.public.windowsce.app.development)
  • Re: Blue screen O.D. twice a day
    ... No you do not have to install the Symboils Package each time. ... I created a Shortcut for Windows Debugger set to the following: ... have a Debug option that will open the WinDBG program. ... Could defective memory cause different error codes, ...
    (microsoft.public.windowsxp.help_and_support)
  • System error text is ANSI?
    ... When run on either Vista or Windows XP, the buffer that is allocated and populated by FormatMessage apparently contains ANSI text rather than Unicode text, and I don't understand why. ... Private Shared Function LocalFree(ByVal hMem As IntPtr) As IntPtr ... ByVal dwMessageId As Int32, _ ...
    (microsoft.public.dotnet.framework.interop)

Loading