You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A connectable object is one that supports outgoing interfaces. An outgoing interface allows the object to communicate with a client. For each outgoing interface, the connectable object exposes a connection point. Each outgoing interface is implemented by a client on an object called a sink.
Each connection point supports the [IConnectionPoint](/windows/desktop/api/ocidl/nn-ocidl-iconnectionpoint) interface. The connectable object exposes its connection points to the client through the [IConnectionPointContainer](/windows/desktop/api/ocidl/nn-ocidl-iconnectionpointcontainer) interface.
@@ -51,7 +51,7 @@ Click **OK** to have the wizard generate your property page.
51
51
52
52
Now that your property page has been generated, you'll need to add a few controls to the dialog resource representing your page. Add an edit box, a static text control, and a check box and set their IDs as shown below:
53
53
54
-

54
+

55
55
56
56
These controls will be used to display the file name of the document and its read-only status.
> This diagram shows that `CComObject` is derived from `CYourClass` whereas `CComAggObject` and `CComPolyObject` include `CYourClass` as a member variable.
@@ -18,7 +18,7 @@ A DHTML control is similar to any ATL control, except:
18
18
19
19
The following graphic illustrates the relationship between your DLL, the DHTML control, the Web browser, and the HTML resource.
20
20
21
-

21
+

22
22
23
23
> [!NOTE]
24
24
> The names on this graphic are placeholders. The names of your HTML resource and the interfaces exposed on your control are based on the names you assign them in the ATL Control Wizard.
@@ -39,7 +39,7 @@ In this graphic, the elements are:
39
39
40
40
The ATL Control Wizard generates a control with default code in both the HTML resource and the .cpp file. You can compile and run the control as generated by the wizard, and then view the control in either the Web browser or the ActiveX Control Test Container. The picture below shows the default ATL DHTML control with three buttons displayed in Test Container:
See [Creating an ATL DHTML Control](../atl/creating-an-atl-dhtml-control.md) to get started building a DHTML control. See [Testing Properties and Events with Test Container](../mfc/testing-properties-and-events-with-test-container.md) for information on how to access Test Container.
@@ -31,8 +31,6 @@ This topic covers the following precompiled header subjects:
31
31
32
32
For reference information on the compiler options related to precompiled headers, see [/Y (Precompiled Headers)](../../build/reference/y-precompiled-headers.md).
33
33
34
-
<aname="when-to-precompile-source-code"></a>
35
-
36
34
## When to Precompile Source Code
37
35
38
36
Precompiled code is useful during the development cycle to reduce compilation time, especially if:
@@ -46,11 +44,9 @@ The first compilation — the one that creates the precompiled header (PCH) file
46
44
You can precompile both C and C++ programs. In C++ programming, it is common practice to separate class interface information into header files. These header files can later be included in programs that use the class. By precompiling these headers, you can reduce the time a program takes to compile.
47
45
48
46
> [!NOTE]
49
-
> Although you can use only one precompiled header (.pch) file per source file, you can use multiple .pch files in a project.
50
-
51
-
<aname="two-choices-for-precompiling-code"></a>
47
+
> Although you can use only one precompiled header (.pch) file per source file, you can use multiple .pch files in a project.
52
48
53
-
# Two Choices for Precompiling Code
49
+
##Two Choices for Precompiling Code
54
50
55
51
With Visual C++, you can precompile any C or C++ code; you are not limited to precompiling only header files.
56
52
@@ -62,14 +58,10 @@ The precompiled-header options are [/Yc (Create Precompiled Header File)](../../
62
58
63
59
The compiler option reference topics for **/Yu** and **/Yc** discuss how to access this functionality in the development environment.
Because PCH files contain information about the machine environment as well as memory address information about the program, you should only use a PCH file on the machine where it was created.
## Consistency Rules for Per-File Use of Precompiled Headers
74
66
75
67
The [/Yu](../../build/reference/yu-use-precompiled-header-file.md) compiler option lets you specify which PCH file to use.
@@ -123,8 +115,6 @@ These pragmas are retained as part of a precompiled header, and affect the remai
123
115
|`data_seg`|`intrinsic`|`warning`|
124
116
|`function`|`optimize`||
125
117
126
-
<aname="consistency-rules-for-yc-and-yu"></a>
127
-
128
118
## Consistency Rules for /Yc and /Yu
129
119
130
120
When you use a precompiled header created using /Yc or /Yu, the compiler compares the current compilation environment to the one that existed when you created the PCH file. Be sure to specify an environment consistent with the previous one (using consistent compiler options, pragmas, and so on) for the current compilation. If the compiler detects an inconsistency, it issues a warning and identifies the inconsistency where possible. Such warnings don't necessarily indicate a problem with the PCH file; they simply warn you of possible conflicts. The following sections explain the consistency requirements for precompiled headers.
@@ -144,24 +134,20 @@ This table lists compiler options that might trigger an inconsistency warning wh
144
134
> [!NOTE]
145
135
> The precompiled header facility is intended for use only in C and C++ source files.
Previous sections present an overview of precompiled headers: /Yc and /Yu, the /Fp option, and the [hdrstop](../../preprocessor/hdrstop.md) pragma. This section describes a method for using the manual precompiled-header options in a project; it ends with an example makefile and the code that it manages.
152
140
153
141
For another approach to using the manual precompiled-header options in a project, study one of the makefiles located in the MFC\SRC directory that is created during the default setup of Visual C++. These makefiles take a similar approach to the one presented in this section but make greater use of Microsoft Program Maintenance Utility (NMAKE) macros, and offer greater control of the build process.
154
142
155
-
<aname="pch-files-in-the-build-process"></a>
156
-
157
143
## PCH Files in the Build Process
158
144
159
145
The code base of a software project is usually contained in multiple C or C++ source files, object files, libraries, and header files. Typically, a makefile coordinates the combination of these elements into an executable file. The following figure shows the structure of a makefile that uses a precompiled header file. The NMAKE macro names and the file names in this diagram are consistent with those in the example code found in [Sample Makefile for PCH](#sample-makefile-for-pch) and [Example Code for PCH](#example-code-for-pch).
160
146
161
147
The figure uses three diagrammatic devices to show the flow of the build process. Named rectangles represent each file or macro; the three macros represent one or more files. Shaded areas represent each compile or link action. Arrows show which files and macros are combined during the compilation or linking process.
162
148
163
-

164
-
##### Structure of a Makefile That Uses a Precompiled Header File
149
+
 <br/>
150
+
Structure of a Makefile That Uses a Precompiled Header File
165
151
166
152
Beginning at the top of the diagram, both STABLEHDRS and BOUNDRY are NMAKE macros in which you list files not likely to need recompilation. These files are compiled by the command string
167
153
@@ -177,8 +163,6 @@ MYAPP.obj represents your final application. It is created from MYAPP.cpp, the f
177
163
178
164
Finally, the executable file (MYAPP.EXE) is created by linking the files listed in the OBJS macro (APPLIB.obj and MYAPP.obj).
179
165
180
-
<aname="sample-makefile-for-pch"></a>
181
-
182
166
## Sample Makefile for PCH
183
167
184
168
The following makefile uses macros and an !IF, !ELSE, !ENDIF flow-of-control command structure to simplify its adaptation to your project.
@@ -244,8 +228,6 @@ NMAKE DEBUG=0
244
228
245
229
For more information on makefiles, see [NMAKE Reference](../../build/nmake-reference.md). Also see [Compiler Options](../../build/reference/compiler-options.md) and the [Linker Options](../../build/reference/linker-options.md).
246
230
247
-
<aname="example-code-for-pch"></a>
248
-
249
231
## Example Code for PCH
250
232
251
233
The following source files are used in the makefile described in [PCH Files in the Build Process](#pch-files-in-the-build-process) and [Sample Makefile for PCH](#sample-makefile-for-pch). Note that the comments contain important information.
Copy file name to clipboardExpand all lines: docs/build/reference/profile-guided-optimization-in-the-performance-and-diagnostics-hub.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: "Profile Guided Optimization in the Performance and Diagnostics Hub"
3
-
ms.date: "03/14/2018"
3
+
ms.date: "11/19/2018"
4
4
ms.assetid: dc3a1914-dbb6-4401-bc63-10665a8c8943
5
5
---
6
6
# Profile Guided Optimization in the Visual Studio 2013 Performance and Diagnostics Hub
@@ -39,44 +39,44 @@ Next, set the build configuration of your app to Release to ready it for the PGO
39
39
40
40
Open the Performance and Diagnostics Hub—on the menu bar, choose **Analyze**, **Performance and Diagnostics**. This opens a diagnostics session page that has the analysis tools that are available for your project type.
41
41
42
-

42
+

43
43
44
44
In **Available Tools**, select the **Profile Guided Optimization** check box. Choose the **Start** button to start the PGO plug-in.
In the **Instrumentation** section, you use the **Training is initially enabled** option to choose whether to include the startup phase of your app as part of the training. If this option is not selected, training data is not recorded in a running instrumented app until you explicitly enable training.
53
53
54
54
Choose the **Instrument** button to build your app with a special set of compiler options. The compiler inserts probe instructions in the generated code. These instructions record profiling data during the training phase.
When the instrumented build of your app is complete, the app is started automatically.
59
59
60
60
If any errors or warnings occur during the build, correct them and then choose **Restart Build** to restart the instrumented build.
61
61
62
62
When your app is started, you can use the **Start Training** and **Pause Training** links in the **Training** section to control when profiling information is recorded. You can use the **Stop Application** and **Start Application** links to stop and restart the app.
63
63
64
-

64
+

65
65
66
66
During training, go through your user scenarios to capture the profiling information that the PGO plug-in needs to optimize the code. When you have completed the training, close your app or choose the **Stop Application** link. Choose the **Analyze** button to start the analysis step.
67
67
68
68
When the analysis is complete, the **Analysis** section shows a report of the profiling information that was captured during the user-scenario training phase. You can use this report to examine which functions your app called the most and spent the most time in. The PGO plug-in uses the information to determine which app functions to optimize for speed and which to optimize for size. The PGO plug-in configures build optimizations to create the smallest, fastest app for the user scenarios that you recorded during training.
If the training captured the expected profiling information, you can choose **Save Changes** to save the analyzed profile data in your project to optimize future builds. To discard the profile data and start the training over from the beginning, choose **Redo Training**.
73
73
74
74
The profile data file is saved in your project in a **PGO Training Data** folder. This data is used to control the compiler build optimization settings in your app.
75
75
76
-

76
+

77
77
78
78
After analysis, the PGO plug-in sets build options in your project to use the profile data to selectively optimize your app during compilation. You can continue to modify and build your app with the same profile data. When the app is built, the build output reports how many functions and instructions were optimized by using profile data.
If you make significant code changes during development, you may have to retrain your app to get the best optimizations. We recommend that you retrain your app when the build output reports that less than 80 percent of functions or instructions were optimized by using profile data.
0 commit comments