久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

TCHAR 仍然相關嗎?

Is TCHAR still relevant?(TCHAR 仍然相關嗎?)
本文介紹了TCHAR 仍然相關嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我是 Windows 編程的新手,在閱讀了 Petzold 的書后,我想知道:

I'm new to Windows programming and after reading the Petzold book I wonder:

使用 TCHAR 類型和 _T() 函數來聲明字符串還是我應該只使用 wchar_t 函數的好習慣> 和 L"" 字符串在新代碼中?

is it still good practice to use the TCHAR type and the _T() function to declare strings or if I should just use the wchar_t and L"" strings in new code?

我將只針對 Windows 2000 及更高版本,并且我的代碼從一開始就是 i18n.

I will target only Windows 2000 and up and my code will be i18n from the start up.

推薦答案

如果我今天在做一個新項目,我仍然會使用 TCHAR 語法.使用它和 WCHAR 語法之間沒有太大的實際區別,我更喜歡明確字符類型的代碼.由于大多數 API 函數和輔助對象采用/使用 TCHAR 類型(例如:CString),因此使用它才有意義.此外,如果您決定在某個時候在 ASCII 應用程序中使用代碼,或者如果 Windows 演變為 Unicode32 等,它會為您提供靈活性.

I would still use the TCHAR syntax if I was doing a new project today. There's not much practical difference between using it and the WCHAR syntax, and I prefer code which is explicit in what the character type is. Since most API functions and helper objects take/use TCHAR types (e.g.: CString), it just makes sense to use it. Plus it gives you flexibility if you decide to use the code in an ASCII app at some point, or if Windows ever evolves to Unicode32, etc.

如果你決定走 WCHAR 路線,我會明確說明這一點.即,使用 CStringW 代替 CString,并在轉換為 TCHAR 時轉換宏(例如:CW2CT).

If you decide to go the WCHAR route, I would be explicit about it. That is, use CStringW instead of CString, and casting macros when converting to TCHAR (eg: CW2CT).

無論如何,這就是我的看法.

That's my opinion, anyway.

這篇關于TCHAR 仍然相關嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Algorithm to convert RGB to HSV and HSV to RGB in range 0-255 for both(將 RGB 轉換為 HSV 并將 HSV 轉換為 RGB 的算法,范圍為 0-255)
How to convert an enum type variable to a string?(如何將枚舉類型變量轉換為字符串?)
When to use inline function and when not to use it?(什么時候使用內聯函數,什么時候不使用?)
Examples of good gotos in C or C++(C 或 C++ 中好的 goto 示例)
Significance of ios_base::sync_with_stdio(false); cin.tie(NULL);(ios_base::sync_with_stdio(false) 的意義;cin.tie(NULL);)
C99 stdint.h header and MS Visual Studio(C99 stdint.h 頭文件和 MS Visual Studio)
主站蜘蛛池模板: 精品国产三级 | 亚欧在线观看 | 日韩在线视频一区二区三区 | 日产精品久久久一区二区 | 国产三级视频在线播放 | 性久久久久 | 成年人黄色 | 久久视频免费 | 精品免费| 欧美黄色精品 | a在线视频 | 日韩福利在线 | 国产精品欧美精品 | 五月婷婷色综合 | 亚洲视频一区二区三区 | www.五月婷婷| 国产一级视频在线观看 | 国产又粗又猛又黄又爽无遮挡 | 日韩欧美精品 | 精品网站999www | www.黄视频 | 日韩精品久久久久久久酒店 | 成人3d动漫 | av福利在线| 国产成人一区二区 | av天天干| 中文字幕精品一区久久久久 | 91一级片| 欧美日韩国产三级 | 久久成人国产 | 丁香激情网 | 国产日产精品一区二区三区的介绍 | 欧美一区二区 | 亚洲va韩国va欧美va精品 | 天天躁日日躁bbbbb | 国产香蕉视频 | 亚洲专区一区 | 九九在线观看高清免费 | 欧美一区二区在线观看 | 激情小说在线视频 | 91麻豆精品国产91久久久久久久久 |