Skip to content

Commit cfca96b

Browse files
author
mikeblome
committed
replace or qualify all references to stdafx.h
1 parent c288700 commit cfca96b

File tree

41 files changed

+140
-91
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+140
-91
lines changed

docs/atl-mfc-shared/reference/cimage-class.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "CImage Class"
3-
ms.date: "02/01/2018"
3+
ms.date: "08/19/2019"
44
f1_keywords: ["CImage", "ATLIMAGE/ATL::CImage", "ATLIMAGE/ATL::CImage::CImage", "ATLIMAGE/ATL::CImage::AlphaBlend", "ATLIMAGE/ATL::CImage::Attach", "ATLIMAGE/ATL::CImage::BitBlt", "ATLIMAGE/ATL::CImage::Create", "ATLIMAGE/ATL::CImage::CreateEx", "ATLIMAGE/ATL::CImage::Destroy", "ATLIMAGE/ATL::CImage::Detach", "ATLIMAGE/ATL::CImage::Draw", "ATLIMAGE/ATL::CImage::GetBits", "ATLIMAGE/ATL::CImage::GetBPP", "ATLIMAGE/ATL::CImage::GetColorTable", "ATLIMAGE/ATL::CImage::GetDC", "ATLIMAGE/ATL::CImage::GetExporterFilterString", "ATLIMAGE/ATL::CImage::GetHeight", "ATLIMAGE/ATL::CImage::GetImporterFilterString", "ATLIMAGE/ATL::CImage::GetMaxColorTableEntries", "ATLIMAGE/ATL::CImage::GetPitch", "ATLIMAGE/ATL::CImage::GetPixel", "ATLIMAGE/ATL::CImage::GetPixelAddress", "ATLIMAGE/ATL::CImage::GetTransparentColor", "ATLIMAGE/ATL::CImage::GetWidth", "ATLIMAGE/ATL::CImage::IsDIBSection", "ATLIMAGE/ATL::CImage::IsIndexed", "ATLIMAGE/ATL::CImage::IsNull", "ATLIMAGE/ATL::CImage::IsTransparencySupported", "ATLIMAGE/ATL::CImage::Load", "ATLIMAGE/ATL::CImage::LoadFromResource", "ATLIMAGE/ATL::CImage::MaskBlt", "ATLIMAGE/ATL::CImage::PlgBlt", "ATLIMAGE/ATL::CImage::ReleaseDC", "ATLIMAGE/ATL::CImage::ReleaseGDIPlus", "ATLIMAGE/ATL::CImage::Save", "ATLIMAGE/ATL::CImage::SetColorTable", "ATLIMAGE/ATL::CImage::SetPixel", "ATLIMAGE/ATL::CImage::SetPixelIndexed", "ATLIMAGE/ATL::CImage::SetPixelRGB", "ATLIMAGE/ATL::CImage::SetTransparentColor", "ATLIMAGE/ATL::CImage::StretchBlt", "ATLIMAGE/ATL::CImage::TransparentBlt"]
55
helpviewer_keywords: ["jpeg files", "bitmaps [C++], ATL and MFC support for", "images [C++], ATL and MFC support for", "gif files, ATL and MFC support", ".gif files, ATL and MFC support", "PNG files, ATL and MFC support", "CImage class", "transparent color"]
66
ms.assetid: 52861e3d-bf7e-481f-a240-90e88f76c490
@@ -137,9 +137,9 @@ Through `CImage`, you have access to the actual bits of a DIB section. You can u
137137
You can use `CImage` from either MFC or ATL.
138138

139139
> [!NOTE]
140-
> When you create a project using `CImage`, you must define `CString` before you include `atlimage.h`. If your project uses ATL without MFC, include `atlstr.h` before you include `atlimage.h`. If your project uses MFC (or if it is an ATL project with MFC support), include `afxstr.h` before you include `atlimage.h`.<br/>
140+
> When you create a project using `CImage`, you must define `CString` before you include *atlimage.h*. If your project uses ATL without MFC, include *atlstr.h* before you include *atlimage.h*. If your project uses MFC (or if it is an ATL project with MFC support), include *afxstr.h* before you include *atlimage.h*.<br/>
141141
> <br/>
142-
> Likewise, you must include `atlimage.h` before you include `atlimpl.cpp`. To accomplish this easily, include `atlimage.h` in your `stdafx.h`.
142+
> Likewise, you must include *atlimage.h* before you include `atlimpl.cpp`. To accomplish this easily, include *atlimage.h* in your *stdafx.h* (*pch.h* in Visual Studio 2019 and later).
143143
144144
## Requirements
145145

docs/atl/adding-a-control-atl-tutorial-part-2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Adding a Control (ATL Tutorial, Part 2)"
33
ms.custom: "get-started-article"
4-
ms.date: "09/26/2018"
4+
ms.date: "08/19/2019"
55
ms.assetid: c9575a75-1064-41f1-9697-7aada560c669
66
---
77
# Adding a Control (ATL Tutorial, Part 2)
@@ -84,7 +84,7 @@ As the wizard creates the control, several code changes and file additions occur
8484

8585
The wizard also makes the following code changes:
8686

87-
- Adds an `#include` statement to the stdafx.h and stdafx.cpp files to include the ATL files necessary for supporting controls.
87+
- Adds an `#include` statement to the precompiled header files to include the ATL files necessary for supporting controls.
8888

8989
- Changes Polygon.idl to include details of the new control.
9090

docs/atl/creating-the-project-atl-tutorial-part-1.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Creating the Project (ATL Tutorial, Part 1)"
33
ms.custom: "get-started-article"
4-
ms.date: "05/06/2019"
4+
ms.date: "08/19/2019"
55
ms.assetid: f6b727d1-390a-4b27-b82f-daadcd9fc059
66
---
77
# Creating the Project (ATL Tutorial, Part 1)
@@ -13,7 +13,7 @@ This tutorial walks you step-by-step through a nonattributed ATL project that cr
1313
1414
> [!NOTE]
1515
> This tutorial creates the same source code as the Polygon sample. If you want to avoid entering the source code manually, you can download it from the [Polygon sample abstract](https://github.com/Microsoft/VCSamples/tree/master/VC2008Samples/ATL/Controls/Polygon). You can then refer to the Polygon source code as you work through the tutorial, or use it to check for errors in your own project.
16-
> To compile, open stdafx.h and replace:
16+
> To compile, open *stdafx.h* (pch.h in Visual Studio 2019) and replace:
1717
> ```
1818
> #ifndef WINVER
1919
> #define WINVER 0x0400
@@ -43,6 +43,24 @@ This tutorial walks you step-by-step through a nonattributed ATL project that cr
4343
4444
Visual Studio will create the project by generating several files. You can view these files in **Solution Explorer** by expanding the `Polygon` object. The files are listed below.
4545
46+
::: moniker range="<=vs-2017"
47+
48+
|File|Description|
49+
|----------|-----------------|
50+
|Polygon.cpp|Contains the implementation of `DllMain`, `DllCanUnloadNow`, `DllGetClassObject`, `DllRegisterServer`, and `DllUnregisterServer`. Also contains the object map, which is a list of the ATL objects in your project. This is initially blank.|
51+
|Polygon.def|This module-definition file provides the linker with information about the exports required by your DLL.|
52+
|Polygon.idl|The interface definition language file, which describes the interfaces specific to your objects.|
53+
|Polygon.rgs|This registry script contains information for registering your program's DLL.|
54+
|Polygon.rc|The resource file, which initially contains the version information and a string containing the project name.|
55+
|Resource.h|The header file for the resource file.|
56+
|Polygonps.def|This module definition file provides the linker with information about the exports required by the proxy and stub code that support calls across apartments.|
57+
|stdafx.cpp|The file that will `#include` *stfafx.h**.|
58+
|stdafx.h|The file that will `#include` and precompile the ATL header files.|
59+
60+
::: moniker-end
61+
62+
::: moniker range=">=vs-2019"
63+
4664
|File|Description|
4765
|----------|-----------------|
4866
|Polygon.cpp|Contains the implementation of `DllMain`, `DllCanUnloadNow`, `DllGetClassObject`, `DllRegisterServer`, and `DllUnregisterServer`. Also contains the object map, which is a list of the ATL objects in your project. This is initially blank.|
@@ -52,8 +70,10 @@ Visual Studio will create the project by generating several files. You can view
5270
|Polygon.rc|The resource file, which initially contains the version information and a string containing the project name.|
5371
|Resource.h|The header file for the resource file.|
5472
|Polygonps.def|This module definition file provides the linker with information about the exports required by the proxy and stub code that support calls across apartments.|
55-
|stdafx.cpp|The file that will `#include` the ATL implementation files.|
56-
|stdafx.h|The file that will `#include` the ATL header files.|
73+
|pch.cpp|The file that will `#include` ^pch.h*.|
74+
|pch.h|The file that will `#include` and precompile the ATL header files.|
75+
76+
::: moniker-end
5777
5878
1. In **Solution Explorer**, right-click the `Polygon` project.
5979

docs/atl/reference/ccommodule-class.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "CComModule Class"
3-
ms.date: "11/04/2016"
3+
ms.date: "08/19/2019"
44
f1_keywords: ["CComModule", "ATLBASE/ATL::CComModule", "ATLBASE/ATL::CComModule::GetClassObject", "ATLBASE/ATL::CComModule::GetModuleInstance", "ATLBASE/ATL::CComModule::GetResourceInstance", "ATLBASE/ATL::CComModule::GetTypeLibInstance", "ATLBASE/ATL::CComModule::Init", "ATLBASE/ATL::CComModule::RegisterClassHelper", "ATLBASE/ATL::CComModule::RegisterClassObjects", "ATLBASE/ATL::CComModule::RegisterServer", "ATLBASE/ATL::CComModule::RegisterTypeLib", "ATLBASE/ATL::CComModule::RevokeClassObjects", "ATLBASE/ATL::CComModule::Term", "ATLBASE/ATL::CComModule::UnregisterClassHelper", "ATLBASE/ATL::CComModule::UnregisterServer", "ATLBASE/ATL::CComModule::UpdateRegistryClass", "ATLBASE/ATL::CComModule::UpdateRegistryFromResourceD", "ATLBASE/ATL::CComModule::UpdateRegistryFromResourceS", "ATLBASE/ATL::CComModule::m_csObjMap", "ATLBASE/ATL::CComModule::m_csTypeInfoHolder", "ATLBASE/ATL::CComModule::m_csWindowCreate", "ATLBASE/ATL::CComModule::m_hInst", "ATLBASE/ATL::CComModule::m_hInstResource", "ATLBASE/ATL::CComModule::m_hInstTypeLib", "ATLBASE/ATL::CComModule::m_pObjMap"]
55
helpviewer_keywords: ["CComModule class", "DLL modules [C++], ATL"]
66
ms.assetid: f5face2c-8fd8-40e6-9ec3-54ab74701769
@@ -648,7 +648,7 @@ A standard HRESULT value.
648648

649649
Similar to [UpdateRegistryFromResourceD](#updateregistryfromresourced) except `UpdateRegistryFromResourceS` creates a static link to the ATL Registry Component (Registrar).
650650

651-
`UpdateRegistryFromResourceS` will be invoked automatically when your object map is processed, provided you add `#define _ATL_STATIC_REGISTRY` to your stdafx.h.
651+
`UpdateRegistryFromResourceS` will be invoked automatically when your object map is processed, provided you add `#define _ATL_STATIC_REGISTRY` to your *stdafx.h* (pch.h in Visual Studio 2019 and later).
652652

653653
> [!NOTE]
654654
> To substitute replacement values at run time, do not specify the [DECLARE_REGISTRY_RESOURCE](registry-macros.md#declare_registry_resource) or [DECLARE_REGISTRY_RESOURCEID](registry-macros.md#declare_registry_resourceid) macro. Instead, create an array of `_ATL_REGMAP_ENTRIES` structures, where each entry contains a variable placeholder paired with a value to replace the placeholder at run time. Then call `UpdateRegistryFromResourceS`, passing the array for the *pMapEntries* parameter. This adds all the replacement values in the `_ATL_REGMAP_ENTRIES` structures to the Registrar's replacement map.

docs/atl/reference/compiler-options-macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Compiler Options Macros"
3-
ms.date: "05/06/2019"
3+
ms.date: "08/19/2019"
44
f1_keywords: ["_ATL_ALL_WARNINGS", "_ATL_APARTMENT_THREADED", "_ATL_CSTRING_EXPLICIT_CONSTRUCTORS ", "_ATL_ENABLE_PTM_WARNING", "_ATL_FREE_THREADED", "_ATL_MULTI_THREADED", "_ATL_NO_AUTOMATIC_NAMESPACE", "_ATL_NO_COM_SUPPORT", "ATL_NO_VTABLE", "ATL_NOINLINE", "_ATL_SINGLE_THREADED"]
55
helpviewer_keywords: ["compiler options, macros"]
66
ms.assetid: a869adc6-b3de-4299-b040-9ae20b45f82c
@@ -51,13 +51,13 @@ Before Visual C++ .NET 2002, ATL disabled a lot of warnings and left them disabl
5151

5252
In projects converted from previous versions, these warnings are still disabled by the libraries headers.
5353

54-
By adding the following line to the stdafx.h file before including libraries headers, this behavior can be changed.
54+
By adding the following line to the *stdafx.h* (pch.h in Visual Studio 2019 and later) file before including libraries headers, this behavior can be changed.
5555

5656
[!code-cpp[NVC_ATL_Utilities#97](../../atl/codesnippet/cpp/compiler-options-macros_1.h)]
5757

5858
If this `#define` is added, the ATL headers are careful to preserve the state of these warnings so that they are not disabled globally (or if the user explicitly disables individual warnings, not to enable them).
5959

60-
New projects have this `#define` set in stdafx.h by default.
60+
New projects have this `#define` set in *stdafx.h* (pch.h in Visual Studio 2019 and later) by default.
6161

6262
## <a name="_atl_apartment_threaded"></a> _ATL_APARTMENT_THREADED
6363

docs/atl/reference/registry-macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Registry Macros"
3-
ms.date: "11/04/2016"
3+
ms.date: "08/19/2019"
44
f1_keywords: ["atlcom/ATL::_ATL_STATIC_REGISTRY", "atlcom/ATL::DECLARE_LIBID", "atlcom/ATL::DECLARE_NO_REGISTRY", "atlcom/ATL::DECLARE_REGISTRY", "atlcom/ATL::DECLARE_REGISTRY_APPID_RESOURCEID", "atlcom/ATL::DECLARE_REGISTRY_RESOURCE", "atlcom/ATL::DECLARE_REGISTRY_RESOURCEID"]
55
helpviewer_keywords: ["registry, ATL macros"]
66
ms.assetid: 3ee041da-c63b-42a4-89cf-2a4b2a6f81ae
@@ -145,7 +145,7 @@ DECLARE_REGISTRY_RESOURCE( x )
145145

146146
When you create an object or control using the ATL Project Wizard, the wizard will automatically implement script-based registry support and add the [DECLARE_REGISTRY_RESOURCEID](#declare_registry_resourceid) macro, which is similar to DECLARE_REGISTRY_RESOURCE, to your files.
147147

148-
You can statically link with the ATL Registry Component (Registrar) for optimized registry access. To statically link to the Registrar code, add the following line to your stdafx.h file:
148+
You can statically link with the ATL Registry Component (Registrar) for optimized registry access. To statically link to the Registrar code, add the following line to your *stdafx.h* file (pch.h in Visual Studio 2019 and later):
149149

150150
[!code-cpp[NVC_ATL_COM#56](../../atl/codesnippet/cpp/registry-macros_2.h)]
151151

@@ -170,7 +170,7 @@ DECLARE_REGISTRY_RESOURCEID( x )
170170

171171
When you create an object or control using the ATL Project Wizard, the wizard will automatically implement script-based registry support and add the DECLARE_REGISTRY_RESOURCEID macro to your files.
172172

173-
You can statically link with the ATL Registry Component (Registrar) for optimized registry access. To statically link to the Registrar code, add the following line to your stdafx.h file:
173+
You can statically link with the ATL Registry Component (Registrar) for optimized registry access. To statically link to the Registrar code, add the following line to your *stdafx.h* file (pch.h in Visual Studio 2019 and later):
174174

175175
[!code-cpp[NVC_ATL_COM#56](../../atl/codesnippet/cpp/registry-macros_2.h)]
176176

docs/atl/reference/specifying-compiler-optimization-for-an-atl-project.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Specifying Compiler Optimization for an ATL Project"
3-
ms.date: "11/04/2016"
3+
ms.date: "08/19/2019"
44
f1_keywords: ["vc.appwiz.ATL.optimization", "vc.appwiz.ATL.vtable"]
55
helpviewer_keywords: ["ATL_DISABLE_NO_VTABLE macro", "ATL projects, compiler optimization", "ATL_NO_VTABLE macro"]
66
ms.assetid: 7f379318-66d5-43dd-a53d-530758d3a228
@@ -38,7 +38,7 @@ If you are unsure whether you should use the `declspec(novtable)` modifier, you
3838
#define _ATL_DISABLE_NO_VTABLE
3939
```
4040

41-
in stdafx.h, before all other ATL header files are included.
41+
in *stdafx.h* (pch.h in Visual Studio 2019 and later), before all other ATL header files are included.
4242

4343
## See also
4444

docs/atl/using-idispeventimpl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Using IDispEventImpl (ATL)"
3-
ms.date: "11/04/2016"
3+
ms.date: "08/19/2019"
44
helpviewer_keywords: ["IDispEventImpl class, using"]
55
ms.assetid: 82d53b61-9d0d-45c5-aff9-2fafa468a9ca
66
---
@@ -40,7 +40,7 @@ methods:
4040
};
4141
```
4242

43-
The example uses `#import` to generate the required header files from Word's type library. If you want to use this example with other versions of Word, you must specify the correct mso dll file. For example, Office 2000 provides mso9.dll and OfficeXP provides mso.dll. This code is simplified from stdafx.h:
43+
The example uses `#import` to generate the required header files from Word's type library. If you want to use this example with other versions of Word, you must specify the correct mso dll file. For example, Office 2000 provides mso9.dll and OfficeXP provides mso.dll. This code is simplified from *stdafx.h* (pch.h in Visual Studio 2019 and later):
4444

4545
[!code-cpp[NVC_ATL_EventHandlingSample#1](../atl/codesnippet/cpp/using-idispeventimpl_1.h)]
4646

docs/atl/using-idispeventsimpleimpl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Using IDispEventSimpleImpl (ATL)"
3-
ms.date: "11/04/2016"
3+
ms.date: "08/19/2019"
44
helpviewer_keywords: ["IDispEventSimpleImpl class, using"]
55
ms.assetid: 8640ad1a-4bd0-40a5-b5e4-7322685d7aab
66
---
@@ -42,7 +42,7 @@ methods:
4242
};
4343
```
4444

45-
The example uses `#import` to generate the required header files from Word's type library. If you want to use this example with other versions of Word, you must specify the correct mso dll file. For example, Office 2000 provides mso9.dll and OfficeXP provides mso.dll. This code is simplified from stdafx.h:
45+
The example uses `#import` to generate the required header files from Word's type library. If you want to use this example with other versions of Word, you must specify the correct mso dll file. For example, Office 2000 provides mso9.dll and OfficeXP provides mso.dll. This code is simplified from *stdafx.h* (pch.h in Visual Studio 2019 and later):
4646

4747
[!code-cpp[NVC_ATL_EventHandlingSample#1](../atl/codesnippet/cpp/using-idispeventsimpleimpl_1.h)]
4848

docs/build/creating-precompiled-header-files.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: "Precompiled Header Files"
3-
ms.date: "05/06/2019"
3+
ms.date: "08/19/2019"
44
helpviewer_keywords: ["precompiled header files, creating", "PCH files, creating", "cl.exe compiler, precompiling code", ".pch files, creating"]
55
ms.assetid: e2cdb404-a517-4189-9771-c869c660cb1b
66
---
77
# Precompiled Header Files
88

9-
When you create a new project in Visual Studio, a *precompiled header file* named "pch.h" is added to the project. (In earlier versions of Visual Studio, the file was called "stdafx.h".) The purpose of the file is to speed up the build process. Any stable header files, for example Standard Library headers such as `<vector>`, should be included here. The precompiled header is compiled only when it, or any files it includes, are modified. If you only make changes in your project source code, the build will skip compilation for the precompiled header.
9+
When you create a new project in Visual Studio, a *precompiled header file* named *pch.h* is added to the project. (In Visual Studio 2017 and earlier, the file was called *stdafx.h*.) The purpose of the file is to speed up the build process. Any stable header files, for example Standard Library headers such as `<vector>`, should be included here. The precompiled header is compiled only when it, or any files it includes, are modified. If you only make changes in your project source code, the build will skip compilation for the precompiled header.
1010

1111
The compiler options for precompiled headers are [/Y](reference/y-precompiled-headers.md). In the project propery pages, the options are located under **Configuration Properties > C/C++ > Precompiled Headers**. You can choose to not use precompiled headers, and you can specify the header file name and the name and path of the output file.
1212

0 commit comments

Comments
 (0)