Skip to content

Repo sync for protected CLA branch #4196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/atl/reference/ccomenum-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The code shown below provides a reusable function for creating and initializing

[!code-cpp[NVC_ATL_COM#32](../../atl/codesnippet/cpp/ccomenum-class_1.h)]

This template function can be used to implement the `_NewEnum` property of a collection interface as shown below:
This function template can be used to implement the `_NewEnum` property of a collection interface as shown below:

[!code-cpp[NVC_ATL_COM#33](../../atl/codesnippet/cpp/ccomenum-class_2.h)]

Expand Down
2 changes: 1 addition & 1 deletion docs/atl/reference/ccomenumonstl-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The code shown below provides a generic function to handle the creation and init

[!code-cpp[NVC_ATL_COM#34](../../atl/codesnippet/cpp/ccomenumonstl-class_1.h)]

This template function can be used to implement the `_NewEnum` property of a collection interface as shown below:
This function template can be used to implement the `_NewEnum` property of a collection interface as shown below:

[!code-cpp[NVC_ATL_COM#35](../../atl/codesnippet/cpp/ccomenumonstl-class_2.h)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,60 @@
---
description: "Learn more about: ATL Program or Control Source and Header Files"
title: "ATL Program or Control Source and Header Files"
ms.date: "11/04/2016"
description: "Learn more about: ATL program or control source and header files"
title: "ATL program or control source and header files"
ms.date: 09/27/2022
helpviewer_keywords: ["file types [C++], ATL source and headers"]
ms.assetid: cb65372f-4880-4007-b582-a52eaa568fd1
---
# ATL Program or Control Source and Header Files
# 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 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 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.
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|
|---------------|-----------------|
|*Projname*.h|The 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*.cpp|The 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.h|The header file for the resource file.|
|StdAfx.cpp|Includes the files StdAfx.h and Atlimpl.cpp.|
|StdAfx.h|Includes the ATL header files.|
::: moniker range=">=msvc-150"

| 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. |

::: moniker-end

::: moniker range="msvc-140"

| 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. |

::: moniker-end

## See also

[File Types Created for Visual Studio C++ projects](file-types-created-for-visual-cpp-projects.md)<br>
[MFC Program or Control Source and Header Files](mfc-program-or-control-source-and-header-files.md)<br>
[CLR Projects](files-created-for-clr-projects.md)
[File types created for Visual Studio C++ projects](file-types-created-for-visual-cpp-projects.md)\
[MFC program or control source and header files](mfc-program-or-control-source-and-header-files.md)\
[Add ATL support to an existing MFC executable or DLL](../../mfc/reference/adding-atl-support-to-your-mfc-project.md)\
[CLR projects](files-created-for-clr-projects.md)
11 changes: 6 additions & 5 deletions docs/build/reference/linker-options.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: "MSVC Linker options"
description: "A list of the options supported by the Microsoft LINK linker."
ms.date: 05/11/2022
ms.date: 09/27/2022
f1_keywords: ["link"]
helpviewer_keywords: ["linker [C++]", "linker [C++], options listed", "libraries [C++], linking to COFF", "LINK tool [C++], linker options"]
ms.assetid: c1d51b8a-bd23-416d-81e4-900e02b2c129
---
# Linker options

LINK.exe links Common Object File Format (COFF) object files and libraries to create an executable (.exe) file or a dynamic-link library (DLL).
LINK.exe links Common Object File Format (COFF) object files and libraries to create an executable (EXE) file or a dynamic-link library (DLL).

The following table lists options for LINK.exe. For more information about LINK, see:

Expand All @@ -22,7 +22,7 @@ The following table lists options for LINK.exe. For more information about LINK,

On the command line, linker options aren't case-sensitive; for example, `/base` and `/BASE` mean the same thing. For details on how to specify each option on the command line or in Visual Studio, see the documentation for that option.

You can use the [comment](../../preprocessor/comment-c-cpp.md) pragma to specify some linker options.
You can use the [`comment`](../../preprocessor/comment-c-cpp.md) pragma to specify some linker options.

## Linker options listed alphabetically

Expand All @@ -43,7 +43,7 @@ You can use the [comment](../../preprocessor/comment-c-cpp.md) pragma to specify
| [`/CLRIMAGETYPE`](clrimagetype-specify-type-of-clr-image.md) | Sets the type (IJW, pure, or safe) of a CLR image. |
| [`/CLRSUPPORTLASTERROR`](clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md) | Preserves the last error code of functions that are called through the P/Invoke mechanism. |
| [`/CLRTHREADATTRIBUTE`](clrthreadattribute-set-clr-thread-attribute.md) | Specifies the threading attribute to apply to the entry point of your CLR program. |
| [`/CLRUNMANAGEDCODECHECK`](clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md) | Specifies whether the linker will apply the SuppressUnmanagedCodeSecurity attribute to linker-generated PInvoke stubs that call from managed code into native DLLs. |
| [`/CLRUNMANAGEDCODECHECK`](clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md) | Specifies whether the linker will apply the `SuppressUnmanagedCodeSecurity` attribute to linker-generated P/Invoke stubs that call from managed code into native DLLs. |
| [`/DEBUG`](debug-generate-debug-info.md) | Creates debugging information. |
| [`/DEBUGTYPE`](debugtype-debug-info-options.md) | Specifies which data to include in debugging information. |
| [`/DEF`](def-specify-module-definition-file.md) | Passes a module-definition (.def) file to the linker. |
Expand All @@ -69,6 +69,7 @@ You can use the [comment](../../preprocessor/comment-c-cpp.md) pragma to specify
| [`/IDLOUT`](idlout-name-midl-output-files.md) | Specifies the name of the *`.idl`* file and other MIDL output files. |
| [`/IGNORE`](ignore-ignore-specific-warnings.md) | Suppresses output of specified linker warnings. |
| [`/IGNOREIDL`](ignoreidl-don-t-process-attributes-into-midl.md) | Prevents the processing of attribute information into an *`.idl`* file. |
| [`/ILK`](ilk-name-incremental-database-file.md) | Overrides the default incremental database file name. |
| [`/IMPLIB`](implib-name-import-library.md) | Overrides the default import library name. |
| [`/INCLUDE`](include-force-symbol-references.md) | Forces symbol references. |
| [`/INCREMENTAL`](incremental-link-incrementally.md) | Controls incremental linking. |
Expand Down Expand Up @@ -126,7 +127,7 @@ You can use the [comment](../../preprocessor/comment-c-cpp.md) pragma to specify
| [`/WINMDFILE`](winmdfile-specify-winmd-file.md) | Specifies the file name for the Windows Runtime Metadata (winmd) output file that's generated by the [`/WINMD`](winmd-generate-windows-metadata.md) linker option. |
| [`/WINMDKEYFILE`](winmdkeyfile-specify-winmd-key-file.md) | Specifies a key or key pair to sign a Windows Runtime Metadata file. |
| [`/WINMDKEYCONTAINER`](winmdkeycontainer-specify-key-container.md) | Specifies a key container to sign a Windows Metadata file. |
| [`/WINMDDELAYSIGN`](winmddelaysign-partially-sign-a-winmd.md) | Partially signs a Windows Runtime Metadata (.winmd) file by placing the public key in the winmd file. |
| [`/WINMDDELAYSIGN`](winmddelaysign-partially-sign-a-winmd.md) | Partially signs a Windows Runtime Metadata (*`.winmd`*) file by placing the public key in the winmd file. |
| [`/WX`](wx-treat-linker-warnings-as-errors.md) | Treats linker warnings as errors. |

<sup>16.1</sup> This option is available starting in Visual Studio 2019 version 16.1.
Expand Down
Loading