Доброй части суток, ner0n.
Вы писали 20.11.2005 12:00 в rsdn.winapi :
n> Подскажите пожалуйста, возможно ли (и если возможно, то как) заставить
n> FormatMessage возвращать описание ошибки на английском языке, в том
n> числе на локализованных версиях Windows?
из описания
FormatMessage:
[cite]
dwLanguageId
[in] Specifies the language identifier for the requested message. This
parameter is ignored if dwFlags includes FORMAT_MESSAGE_FROM_STRING.
If you pass a specific LANGID in this parameter, FormatMessage will return a
message for that LANGID only. If the function cannot find a message for that
LANGID, it returns ERROR_RESOURCE_LANG_NOT_FOUND. If you pass in zero,
FormatMessage looks for a message for LANGIDs in the following order:
1.. Language neutral
2.. Thread LANGID, based on the thread's locale value
3.. User default LANGID, based on the user's default locale value
4.. System default LANGID, based on the system default locale value
5.. US English
If FormatMessage doesn't find a message for any of the preceding LANGIDs, it
returns any language message string that is present. If that fails, it
returns ERROR_RESOURCE_LANG_NOT_FOUND.
[/cite]
Т.е., при явном указании LANGID функция возвращает сообщение на требуемом
языке, либо ошибку если такой языковой ресурс не найден.
Попробовал указать MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US) на XP eng —
там всё срабатывает. К сожалению не смог попробовать на других версиях.
--
На этом прощаюсь, CTpaHHoe.
mail-to-CTpaHHoe-at-hotbox-dot-ru
Posted via RSDN NNTP Server 2.0 beta