win2k内核是unicode, w98内核不是unicode. 你的文本文件是unicode编码?
解决方案 »
- 跪求高手指点(急)
- 请问 : 截获通过IE收邮件数据,怎么各个网站截获收邮件的数据都变成密文,对这种密文该如何解析
- 新手问题:自己创建的CDialog对话框里的控件为什么不能用?
- 请问那为有图象匹配的代码?
- 最简单的问题 0xe不等于14吗?
- 500分!求救!要是不够再开几张帖子!
- 救命啊~~——一个关于单文档多视区的问题,高分相送,解决立即给分!
- SendMessage时编译没有问题,运行出现0xccccccec不能为read错误,发送的是CString消息,急求助
- VC++ GDI+
- 关于创建SAFEARRAY的问题.一定给分
- DLL编译问题 cl.exe test.cpp /LD报错误!
- 如何用MFC做一个文件分割器,主要是算法,很紧急,我只有这么多分了。。。。帮帮忙
(UNICODE编码标记)
比如程序中的字串使用了_T("版本")定义格式?
m_GR0 = _T("");
m_GR1 = _T("");
m_GR2 = _T("");
m_GR3 = _T("");
m_GR4 = _T("");
m_PC = _T("");
m_SP = _T("");
m_FR = _T("");
m_BINARY = _T("");
m_COMBO = _T("");
什么意思呢?刚用VC问题就是多
#define _UNICODE, 即是否支持UNICODE来选择合适的版本进行编译。
在内核是unicode的操作系统中,_T("版本")按照unicode字串 wchar []="版本"进行了编译
在内核不是unicode的操作系统中,_T("版本")按照字普通串 char []="版本"进行了编译所以在w2k下编译出的程序是UNICODE版本,在win98下无法正确显示
1)选择菜单"project->settings..."
2)在project settings dialog中选择C/C++ tab.
3)察看 "Preprocessor definitions:"中有没有定义 _UNICODE
一切都会水落石出的. 你先看看这篇文章(from MSDN,title: "Using Generic-Text Mappings"),如果不幸还是不能解决你的问题, 你可以将工程源代码mail给我,如果你愿意...
Using Generic-Text Mappings
Microsoft Specific —>To simplify code development for various international ets, the Microsoft run-time library provides Microsoft-specific “generic-text” mappings for many data types, routines, and other objects. These mappings are defined in TCHAR.H. You can use these name mappings to write generic code that can be compiled for any of the three kinds of character sets: ASCII (SBCS), MBCS, or Unicode, depending on a manifest constant you define using a #define statement. Generic-text mappings are Microsoft extensions that are not ANSI compatible.Preprocessor Directives for Generic-Text Mappings#define Compiled Version Example
_UNICODE Unicode (wide-character) _tcsrev maps to _wcsrev
_MBCS Multibyte-character _tcsrev maps to _mbsrev
None
(the default: neither _UNICODE nor _MBCS defined) SBCS (ASCII) _tcsrev maps to strrev
For example, the generic-text function _tcsrev, defined in TCHAR.H, maps to mbsrev if MBCS has been defined in your program, or to _wcsrev if _UNICODE has been defined. Otherwise _tcsrev maps to strrev. The generic-text data type _TCHAR, also defined in TCHAR.H, maps to type char if _MBCS is defined, to type wchar_t if _UNICODE is defined, and to type char if neither constant is defined. Other data type mappings are provided in TCHAR.H for programming convenience, but _TCHAR is the type that is most useful. Generic-Text Data Type MappingsGeneric-Text Data Type Name SBCS (_UNICODE, _MBCS Not Defined)
_MBCS Defined
_UNICODE Defined
_TCHAR char char wchar_t
_TINT int int wint_t
_TSCHAR signed char signed char wchar_t
_TUCHAR unsigned char unsigned char wchar_t
_TXCHAR char unsigned char wchar_t
_T or _TEXT No effect (removed by preprocessor) No effect (removed by preprocessor) L (converts following character or string to its Unicode counterpart)
For a complete list of generic-text mappings of routines, variables, and other objects, see Appendix B, Generic-Text Mappings.The following code fragments illustrate the use of _TCHAR and _tcsrev for mapping to the MBCS, Unicode, and SBCS models._TCHAR *RetVal, *szString;
RetVal = _tcsrev(szString);If MBCS has been defined, the preprocessor maps the preceding fragment to the following code:char *RetVal, *szString;
RetVal = _mbsrev(szString);If _UNICODE has been defined, the preprocessor maps the same fragment to the following code:wchar_t *RetVal, *szString;
RetVal = _wcsrev(szString);If neither _MBCS nor _UNICODE has been defined, the preprocessor maps the fragment to single-byte ASCII code, as follows:char *RetVal, *szString;
RetVal = strrev(szString);Thus you can write, maintain, and compile a single source code file to run with routines that are specific to any of the three kinds of character sets. See Also Generic-text mappings, Data type mappings, Constants and global variable mappings, Routine mappings, A sample generic-text propgramEND Microsoft Specific