Bagikan melalui


CLR Console Application Template (C++)

The Console Application template adds the necessary items needed to create a console application. Console applications are typically designed without a graphical user interface and are compiled into a stand-alone executable file. A console application is run from the command line with input and output information being exchanged between the command prompt and the running application. Because information can be written to and read from the console window, this makes the console application a great way to learn new programming techniques without having to be concerned with the user interface.

The template automatically adds the essential project references and files to use as a starting point for your application:

  • References to these .NET Framework namespaces:

    • System - Contains fundamental classes and base classes that define commonly used values and reference data types, events and event handlers, interfaces, attributes, and processing exceptions.

    • mscorlib - The assembly DLL that provides .NET Framework support.

  • Source files:

    • Console (.cpp file) - The main source file and entry point into the application that Visual Studio created for you. Identifies the project .dll file and the project namespace. Provide your own code in this file.

    • AssemblyInfo.cpp - The file that contains information (that is, attributes, files, resources, types, versioning information, signing information, and so on) for modifying the project's assembly metadata. For more information, see Assembly Concepts in the Windows Software Development Kit (SDK).

    • Stdafx.cpp - Used to build a precompiled header file named Win32.pch and a precompiled types file named StdAfx.obj.

  • Header files:

    • Stdafx.h - Used to build a precompiled header file named Win32.pch and a precompiled types file named StdAfx.obj.

    • resource.h - A generated include file for app.rc.

  • Resource files:

    • app.rc - The resource script file of a program.

    • app.ico -The icon file of a program.

  • ReadMe.txt - A file describing each file in your project using the actual filenames created by the template.

See Also

Tasks

How to: Create CLR Console Applications

Reference

Files Created for CLR Projects

Concepts

Item Management in Projects

Other Resources

Managing Solutions, Projects, and Files