如下,一个支持MFC的控制台程序:在VC6下能输出hello,而在Vc2005下不行,为什么?是否VC2005在MFC上的该进?要在VC2005下输出hello,该怎么做?是否只能将CString的字符串一个个复制到一个char数组里输出?
谢谢!!!
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0; // initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
else
{
// TODO: code your application's behavior here.
CString strHello="hello";

cout << (LPCTSTR)strHello << endl;
} return nRetCode;
}