三.再在C/C++選項卡中的在Category中選擇Code Generation,
再在Use run-time library中選擇Debug Multithreaded或者multithreaded
其中,
Single-Threaded單線程靜態鏈接庫(release版本)
Multithreaded多線程靜態鏈接庫(release版本)
multithreaded DLL多線程動態鏈接庫(release版本)
Debug Single-Threaded單線程靜態鏈接庫(debug版本)
Debug Multithreaded多線程靜態鏈接庫(debug版本)
Debug Multithreaded DLL多線程動態鏈接庫(debug版本)
選擇Debug Multithreaded(如果你在Win32 Debug環境下)
之後敲入你的代碼:
#include "stdafx.h"
#include <afx.h> // 注意要加上你所用的類的頭文件
#include <stdio.h>
int main(int argc, char* argv[])
{
CTime time;
time = CTime::GetCurrentTime();
CString str = time.Format("%H:%M:%S");
printf("當前時間爲%s/n",(LPCTSTR)str);
return 0;
}
在編譯時往往提示設置有改動,是否繼續,選擇“是”
四.大功告成。
運行結果: