1. Create a Win32 consystemic application project: getcurrenttime.
2. Open the "project" menu --> "setting" menu item --> General Tab
In Microsoft fountion classes:, select use MFC in static library.
3. On the C/C ++ tab, select code generation in category,
Select debug multithreaded or multithreaded in the use run-time library.
Where,
Single-threaded single-thread static link library (Release Version)
Multithreaded multi-thread static link library (Release Version)
Multithreaded DLL multi-thread dynamic link library (Release Version)
Debug single-threaded single-thread static link library (debug version)
Debug multithreaded multi-thread static link library (debug version)
Debug multithreaded DLL multi-thread dynamic link library (debug version)
Select debug multithreaded (if you are in Win32 debug environment)
Then, enter your code:
# Include "stdafx. H"
# Include <afx. h> // Add the header file of your class.
# Include <stdio. h>
Int main (INT argc, char * argv [])
{
Ctime time;
Time = ctime: getcurrenttime ();
Cstring STR = time. Format ("% H: % m: % s ");
Printf ("Current Time: % s/n", (lpctstr) Str );
Return 0;
}
During compilation, you are often prompted to change the settings and whether to continue. Select "yes"