EVC speaks in a sense that a subset of VCs. Because most of the EVC features, VC also has, while VC features, EVC does not necessarily have. In VC, the operation string is very convenient, because Windows's word processing power is very powerful, it supports multiple character sets. We just use a cstring str = "Hello", you must enter the Chinese string we want. This situation is changed in EVC, because WinCe's word processing power is not strong enough, it is a Unicode encoding in handling the Chinese characters, so we need to use a Unicode encoding when you have a Chinese string in EVC. Below the processing of the VC string under Windows, compare the phrase method of the EVC Chinese string.
First, Chinese string definition
1. In the VC, if we define a Chinese string, you can use the cstring str = "Hello" or lpctstr str = "Hello".
2, in EVC, if we want to define a Chinese string, you can use the following method: cstring str = _t ("Hello") or lpctstr str = "Hello", where lpctstr is in EVC to represent a Unicode string. It is worth noting that in the _t () macro, only the constants can only be filled in parentheses, and the variables cannot be filled.
Second, string operation
1. We want to copy strings in VC, you can do the following:
Char s [20];
CString str = "Hello";
STRCPY (S, STR);
In the EVC, you can't do this. First, the Chinese array should use the double-byte pointer WCHAR_T, and the copy function cannot be used with strcpy, but should use: wchar_t * wcscpy (wchar_t * wster, wchar_t wsource); function, operation as follows:
Wchar_t s [20];
CString str = "Hello";
WCSCPY (s, (lpctstr) str); // No to Unicode encoding, so there is a need for forced conversion
2, in the VC we want to find a sub-string in a string, just need to do the following:
CString str = "You are a good student";
Str.Find ("Student");
Don't do this in EVC, because Chinese strings are Unicode encodings, we must make the following modifications in the parameters of the Find function:
Str.Find (_t ("student"));
The above is some accumulation of the Chinese string when I use the EVC written application, in the case of the time required for future needs.