Use the MFC class in Win32 consystemic Application

Source: Internet
Author: User

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"

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.