Can't get correct string when dynamic module load failed.

Create issue
Issue #178 resolved
Former user created an issue

Automatic migration. Original reporter: "thejinchao"

file: "CEGUIDynamicModule.cpp" function: "String DynamicModule::getFailureString() const"

........ if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), <--This line! reinterpret_cast<LPTSTR>(&msgBuffer), 0, 0)) { retMsg = reinterpret_cast<LPTSTR>(msgBuffer); LocalFree(msgBuffer); } ........

If the default language of windows system is not englisth like (etc. chinese), the contents of retMsg will be incorrect. Because CEGUI::String is not support "utf16" string yet. I suggest use english as language identifier. As blow:


Because english(us) code page is always installed at most windows system.

Reproducibility: always

Comments (2)

  1. Paul Turner

    I have fixed this by applying the change as suggested - thanks a lot :)

    Fix is currently in branches/v0-6 at rev 1705; will merge back into trunk with the next batch of fixes to be merged.

  2. Log in to comment