ATL Program or Control Source and Header Files


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at ATL Program or Control Source and Header Files.

The following files are created when you create an ATL project in Visual Studio, depending on the options you select for the project you create.

All of these files are located in the Projname directory, and in either the Header Files (.h files) folder or Source Files (.cpp files) folder in Solution Explorer.

File nameDescription
Projname.hThe main include file containing the C++ interface definitions and GUID declarations of the items defined in ATLSample.idl. It is regenerated by MIDL during compilation.
Projname.cppThe main program source file. It contains the implementation of your DLL's exports for an in-process server and the implementation of WinMain for a local server. For a service, this additionally implements all the service management functions.
Resource.hThe header file for the resource file.
StdAfx.cppIncludes the files StdAfx.h and Atlimpl.cpp.
StdAfx.hIncludes the ATL header files.

File Types Created for Visual C++ Projects
MFC Program or Control Source and Header Files
CLR Projects