Use MSlu to write Unicode programs under Win982K in VC6.0

xiaoxiao2021-03-06  40

Write the Unicode program used under Win98 system, you can use MSlu.

First, use MSlu options

Second, call unicows.dll failed to fail

Third, the function that cannot work properly on MSLU

Fourth, for the processing of the ON_NOTIFY notification message.

First, use MSlu options

MFC Static Link Release Version

C / C option:

Remove _mbcs Add _unicore, Unicode

LINK options:

Output-> Entry Point Symbol:

WwinMainCrtStartup

Object / Library Modules:

unicows.lib kernel32.lib advapi32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib version.lib mpr.lib rasapi32.lib winmm.lib winspool.lib vfw32.lib oleacc.lib oledlg.lib uafxcw.lib libcmt. Lib

MFC static link debug version:

UNICOWS.LIB VERSION.LIB MPR.LIB Rasapi32.lib Winmm.lib vfw32.lib oleacc.lib oledlg.lib uafxcwd.lib libcmtd.lib

Second, call unicows.dll failed to fail

The following functions are notified when unicows.dll cannot be loaded under Win98.

HModule LoadunicationsProc (void) {hmodule hmod = loadingLibrarya ("unicows.dll"); if (hmod == 0) {MessageBoxa (0, "Unicows.dll Unicode Wrapper Not Found!", "MWP", MB_ICONSTOP | MB_OK); _exit (-1);} return (hmod);} extern "c" farproc _pfnloadunications = (farproc) & loadingsproc;

Third, the function that cannot work properly on MSLU

Some functions cannot be used in the MSLU environment, and they need to be converted in this situation.

For example MmioPen

#ifdef _UNICODE if (IsWin98 ()) {USES_CONVERSION; if | {AfxMessageBox (IDS_ERR_OPENWAVEFILE) ((m_hmmio = :: mmioOpenA (W2A (lpszFileName), NULL, MMIO_READ MMIO_ALLOCBUF))!); return FALSE;}} else {if ( !! (m_hmmio = mmioOpen ((LPTSTR) lpszFileName, NULL, MMIO_READ | MMIO_ALLOCBUF))) {AfxMessageBox (IDS_ERR_OPENWAVEFILE); return FALSE;}} #else if ((m_hmmio = mmioOpen ((LPTSTR) lpszFileName, NULL, MMIO_READ | MMIO_ALLOCBUF ))) {AFXMessageBox (IDS_ERR_Openwavefile); return false;} #ENDIF

Fourth, for the processing of the ON_NOTIFY notification message.

For ON_Notity notices, because there is a distinction unicode non-Unicode version, you need to pay attention to:

ON_NOTIFY (TVN_Item_tree, onItem_path_tree, onItemXPandingPathtree)

ON_NOTIFY (TVN_Item_tree, OnItemXPancePathtree) ON_NOTIFY (TVN_IiteMexPandingw, IDC_Path_tree, OnItemExpandingPathtree)

This can work properly under Win98 / 2K.

转载请注明原文地址:https://www.9cbs.com/read-59995.html

New Post(0)