Edit

Share via


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. The file names depend on the name you choose for your project, which we'll call ProjectName.

All of the files created by the project template are located in the ProjectName and ProjectNamePS project directories. In Solution Explorer, the ProjectName files are located in the Generated Files, Header Files, Resource Files, and Source Files folders. The ProjectNamePS files are in the Generated Files and Source Files folders. Not all files listed here are generated for every project type. Files in the Generated Files folder are generated automatically by the MIDL compiler; they shouldn't be edited directly.

File name Description
ProjectName_i.c The generated source file containing the C++ IID and CLSID definitions and GUID declarations of the items defined in ProjectName.idl. Don't edit this file; it's regenerated by MIDL during compilation. Link this file with the server and any clients.
ProjectName_i.h The generated include file containing the C++ interface declarations and GUID declarations of the items defined in ProjectName.idl. Don't edit this file; it's regenerated by MIDL during compilation. Include this file in source files for the server and any clients.
ProjectName.rc The main program resource file.
ProjectName.rgs The main program registration file.
ProjectName.cpp The main program source file. In DLL projects, it contains the implementation of your DLL's exports for an in-process server. In EXE projects, it contains the implementation of WinMain for a local server. For a service, this file implements all the service management functions.
ProjectName.def In DLL projects, the definitions for your DLL's exports.
ProjectName.idl The IDL source for your project. The MIDL tool processes this file to produce the type library (.tlb) and marshaling code.
framework.h Sets preprocessor macros and includes the ATL header files, the targetver.h version support header, and the Resource.h resource file header.
dllmain.h In DLL projects, the header file for the module class.
dllmain.cpp In DLL projects, the source file for the DllMain function.
Resource.h The header file for the resource file.
targetver.h Includes SDKDDKVer.h. To build your application for a previous Windows platform, include WinSDKVer.h and set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
pch.cpp Includes the file pch.h.
pch.h Includes the framework.h header file.
File name Description
ProjectName_i.c The generated source file containing the C++ IID and CLSID definitions and GUID declarations of the items defined in ProjectName.idl. Don't edit this file; it's regenerated by MIDL during compilation. Link this file with the server and any clients.
ProjectName_i.h The generated include file containing the C++ interface declarations and GUID declarations of the items defined in ProjectName.idl. Don't edit this file; it's regenerated by MIDL during compilation. Include this file in source files for the server and any clients.
ProjectName.rc The main program resource file.
ProjectName.rgs The main program registration file.
ProjectName.cpp The main program source file. In DLL projects, it contains the implementation of your DLL's exports for an in-process server. In EXE projects, it contains the implementation of WinMain for a local server. For a service, this file implements all the service management functions.
ProjectName.def In DLL projects, the definitions for your DLL's exports.
ProjectName.idl The IDL source for your project. The MIDL tool processes this file to produce the type library (.tlb) and marshaling code.
dllmain.h In DLL projects, the header file for the module class.
dllmain.cpp In DLL projects, the source file for the DllMain function.
resource.h The header file for the resource file.
targetver.h Includes SDKDDKVer.h. To build your application for a previous Windows platform, include WinSDKVer.h and set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
stdafx.cpp Includes the file stdafx.h.
stdafx.h Sets preprocessor macros and includes the ATL header files, the targetver.h version support header, and the resource.h resource file header.

See also

File types created for Visual Studio C++ projects
MFC program or control source and header files
Add ATL support to an existing MFC executable or DLL
CLR projects