MSLU
From WxWiki
Unicode works on windows2000, XP, 2003 and so on, not on win98/Me. So you would have to build two versions of program (.exe) for win98/me and for the newer ones.
But using MSLU you can build one, unicode version, and run it on win98/me as well on 2000/xp - only load a runtime lib unicows.dll.
Usually MSLU works like this:
- (the .a) libunicows.a - the program source have to link (not with wx-read below) to a small static library MSLU-loader (libcows). It has to be the first librarry linked (edit makefile etc) download for MinGW (and MSVC?) libunicows loader .a
- (the .dll) unicows.dll - there must be libcows runtime dll in same dir as program (download from microsoft support page, but now shure about redistribution)
With wx Widgets the first item is not needed - no need to link the .a from libunicows/opencows/etc - because wx provides own libcows loader itself. Do not link libunicows by hand when using wx. But you still need to get the .dll runtime from microsoft support page.
[edit] Works With
- MSVC (as reported by "Sick" on #wxwidgets irc.freenode.net)
- MinGW crosscompile (from linux to win32) as tested {testing now 21-03-2006} by "Raf256"
- probably MinGW win32 as stated in docs
- perhaps others? edit wiki if You know.
- of course on non-Microsoft OS such workarounds are not needed :)
[edit] Using
To use MSLU:
- Enable MSLU support (--enable-mslu in configure of source code of wx widgets lib)
- If enable failed (I think there is a bug in 2.6.3-rc1?) or when on platform without configure (MSVC) - then do it manually, by editing include/wx/msw/setup_microwin.h (also setup.h setup0.h) and setting #define wxUSE_UNICODE_MSLU 1 (and wxUSE_UNICODE 1 as well in these files)
- The code responsible for loading MSLU in wxWidgets lib source is in src/msw/main.cpp line ~270 search for "program uses Unicode"
- make / build
- install
- install the libs! (in example copy dlls to correct directory to really use it!)
- change the lib range in your project: first /nod:xxx.lib for all win-libs, then unicows.lib, then win-libs and at last wx-libs (example: /nod:kernel.lib /nod:user32.lib /nod:gdi32.lib unicows.lib kernel32.lib user32.lib gdi32.lib wxmsw28u_core.lib wxbase28u.lib)
- rebuild your program
- make sure it uses the correct dlls
- get the MSLU runtime in example from microsoft's support page and put it in the
directory of program (the license of unicows.dll allows redistribution to essentially any version of Windows, royalty free).
- now it should work on both win 98/me and 2000/xp.
[edit] More Information
- On WINE Windows Emulator you can run winecfg and set it to run programs as Window 98 to test MSLU.
- comp.soft-sys.wxwindows MSLU Problem Thread
- MSLU: Develop Unicode Applications for Windows 9x Platforms with the Microsoft Layer for Unicode
