使用win32控制台应用程序也能调通的啊,按Alt+F7,在C/C++的Category中选Code Generation,然后Use run-time library选Multithreaded,然后我直接写的代码:
#include <afx.h>
#include <iostream.h>
#include <time.h>
#include <afxtempl.h>
void main()
{
CString MyString;
CTime t=CTime::GetCurrentTime();
cout < <t.GetYear() < <endl < <t.GetDayOfWeek()
< <endl < <t.GetTime() < <endl < <t.GetGmtTm()-> tm_year < <endl;
MyString=t.Format( "%A, %B %d, %Y ");
cout < <t.GetLocalTm()-> tm_year < <endl < <MyString;
}
也能运行的。
#include <afx.h>
#include <iostream.h>
#include <time.h>
#include <afxtempl.h>
void main()
{
CString MyString;
CTime t=CTime::GetCurrentTime();
cout < <t.GetYear() < <endl < <t.GetDayOfWeek()
< <endl < <t.GetTime() < <endl < <t.GetGmtTm()-> tm_year < <endl;
MyString=t.Format( "%A, %B %d, %Y ");
cout < <t.GetLocalTm()-> tm_year < <endl < <MyString;
}
也能运行的。