--- np2/wince/np2.cpp 2005/02/11 21:17:23 1.21 +++ np2/wince/np2.cpp 2005/04/01 15:35:50 1.24 @@ -6,6 +6,7 @@ #include "resource.h" #include "strres.h" #include "np2.h" +#include "oemtext.h" #include "dosio.h" #include "commng.h" #include "inputmng.h" @@ -108,11 +109,11 @@ static int flagload(const OEMCHAR *ext, id = DID_YES; ret = statsave_check(path, buf, NELEMENTS(buf)); if (ret & (~STATFLAG_DISKCHG)) { - menumbox("Couldn't restart", title, MBOX_OK | MBOX_ICONSTOP); + menumbox(OEMTEXT("Couldn't restart"), title, MBOX_OK | MBOX_ICONSTOP); id = DID_NO; } else if ((!force) && (ret & STATFLAG_DISKCHG)) { - OEMSPRINTF(buf2, "Conflict!\n\n%s\nContinue?", buf); + OEMSPRINTF(buf2, OEMTEXT("Conflict!\n\n%s\nContinue?"), buf); id = menumbox(buf2, title, MBOX_YESNOCAN | MBOX_ICONQUESTION); } if (id == DID_YES) { @@ -308,38 +309,6 @@ static void processwait(UINT cnt) { // ---- -#if defined(UNICODE) && defined(OSLANG_SJIS) -static DWORD _GetModuleFileName(HMODULE hModule, - OEMCHAR *lpFileName, DWORD nSize) { - - UINT16 ucs2[MAX_PATH]; - - GetModuleFileName(hModule, ucs2, NELEMENTS(ucs2)); - nSize = WideCharToMultiByte(CP_ACP, 0, ucs2, -1, - lpFileName, nSize, NULL, NULL); - if (nSize) { - nSize--; - } - return(nSize); -} -#elif defined(OSLANG_UTF8) -static DWORD _GetModuleFileName(HMODULE hModule, - OEMCHAR *lpFileName, DWORD nSize) { - - UINT16 ucs2[MAX_PATH]; - - GetModuleFileName(hModule, ucs2, NELEMENTS(ucs2)); - nSize = ucscnv_ucs2toutf8(lpFileName, nSize, ucs2, (UINT)-1); - if (nSize) { - nSize--; - } - return(nSize); -} -#else -#define _GetModuleFileName(a, b, c) GetModuleFileName(a, b, c) -#endif - - #if defined(_WIN32_WCE) int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst, LPWSTR lpszCmdLine, int nCmdShow) @@ -368,7 +337,13 @@ int WINAPI WinMain(HINSTANCE hInstance, return(0); } - _GetModuleFileName(NULL, modulefile, NELEMENTS(modulefile)); +#if defined(OEMCHAR_SAME_TCHAR) + GetModuleFileName(NULL, modulefile, NELEMENTS(modulefile)); +#else + TCHAR _modulefile[MAX_PATH]; + GetModuleFileName(NULL, _modulefile, NELEMENTS(_modulefile)); + tchartooem(modulefile, NELEMENTS(modulefile), _modulefile, (UINT)-1); +#endif dosio_init(); file_setcd(modulefile); initload();