#ifdef _UNICODE
#define _tmain wmain
#define _tWinMain wWinMain
也就是说,wmain()是UNICODE版本的main(), _tmain()是个宏,如果是UNICODE则它是wmain(),否则它是main(),wWinMain()与_tWinMain()的区别也相同;以下是msdn中关于这些函数的描述:
A special function named main is the starting point of execution for all C and C++ programs. If you are writing code that adheres to the Unicode programming model, you can use wmain, which is the wide-character version of main.
在所有C和C++程序中,以一个叫main的特殊函数作为应用程序的入口点,如果你希望在程序中使用Unicode 编码,那么你可以使用wmain,这是main函数的宽字符版本。
You can also use _tmain, which is defined in TCHAR.h. _tmain resolves to main unless _UNICODE is defined. In that case, _tmain resolves to wmain.
同时,我们可以使用_tmain,它在TCHAR.h头文件中定义,如果没有定义_UNICODE,那么_tmain会转换成mian,否则会被转换成wmain。