GetComputerNameA()跟GetComputerNameW()区别

GetComputerNameA()和GetComputerNameW()区别MFC程序,使用 Unicode 字符集为什么我在WIN7系统上用 GetComp

GetComputerNameA()和GetComputerNameW()区别
MFC程序,使用 Unicode 字符集

为什么我在WIN7系统上用 GetComputerNameA()和GetComputerNameW()得到一样的结果

而在虚拟机XP系统上 GetComputerNameA() 正常,而GetComputerNameW()为空或乱符号。

而 GetCurrentDirectoryA() 和 GetCurrentDirectoryW()却没区别?


[解决办法]
我曾经做过一个实验:

我去查看definition,
在unicode字符集的情况下:
TCHAR就是WCHAR

在多字节的情况下:
WCHAR就是TCHAR

都用预编译给分开了。
就是说,如果你的项目不设定固定字符,这些函数显示其专属特性。