首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

_tmain()是个宏?什么是宏,解决方案

2013-12-10 
_tmain()是个宏?什么是宏,经常听到宏,但到底什么是宏,_tmain()是个宏?又是什么意思。。。请用通俗简洁的语言

_tmain()是个宏?什么是宏,
经常听到宏,但到底什么是宏,_tmain()是个宏?又是什么意思。。。请用通俗简洁的语言说明下,谢谢。。。
[解决办法]
用A等价替换B
[解决办法]
VS IDE中,在不明白的符号上点鼠标右键,选转到定义。

[解决办法]

#ifdef _WINMAIN_
            /*
             * Skip past program name (first token in command line).
             * Check for and handle quoted program name.
             */
#ifdef WPRFLAG
            lpszCommandLine = (wchar_t *)_wcmdln;
#else  /* WPRFLAG */
            lpszCommandLine = (unsigned char *)_acmdln;
#endif  /* WPRFLAG */

            while (*lpszCommandLine > SPACECHAR 
[解决办法]

                   (*lpszCommandLine&&inDoubleQuote)) {
                /*
                 * Flip the count from 1 to 0 or 0 to 1 if current character
                 * is DOUBLEQUOTE
                 */
                if (*lpszCommandLine==DQUOTECHAR) inDoubleQuote=!inDoubleQuote;
#ifdef _MBCS
                if (_ismbblead(*lpszCommandLine)) {
                    if (lpszCommandLine) {
                        lpszCommandLine++;
                    }
                }
#endif  /* _MBCS */
                ++lpszCommandLine;
            }

            /*
             * Skip past any white space preceeding the second token.
             */
            while (*lpszCommandLine && (*lpszCommandLine <= SPACECHAR)) {
                lpszCommandLine++;
            }

#ifdef WPRFLAG
            mainret = wWinMain(
#else  /* WPRFLAG */
            mainret = WinMain(
#endif  /* WPRFLAG */
                       (HINSTANCE)&__ImageBase,
                       NULL,
                       lpszCommandLine,
                       showWindowMode
                      );
#else  /* _WINMAIN_ */



#ifdef WPRFLAG
            __winitenv = envp;
            mainret = wmain(argc, argv, envp);
#else  /* WPRFLAG */
            __initenv = envp;
            mainret = main(argc, argv, envp);
#endif  /* WPRFLAG */


[解决办法]
 原来_tmain的_t和宏_T有点像 在unicode中翻译成wmain 在 多字节中翻译成main
they've defined _tmain which, if Unicode is enabled, is compiled as wmain, and otherwise as main

热点排行