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
@@ -52,7 +51,7 @@ class CComVariant : public tagVARIANT
52
51
53
52
## Remarks
54
53
55
-
`CComVariant` wraps the `VARIANT` and `VARIANTARG` type, which consists of a union and a member indicating the type of the data stored in the union. VARIANTs are typically used in Automation.
54
+
`CComVariant` wraps the `VARIANT` and `VARIANTARG` type, which consists of a union and a member indicating the type of the data stored in the union. `VARIANT`s are typically used in Automation.
56
55
57
56
`CComVariant` derives from the `VARIANT` type so it can be used wherever a `VARIANT` can be used. You can, for example, use the `V_VT` macro to extract the type of a `CComVariant` or you can access the `vt` member directly just as you can with a `VARIANT`.
58
57
@@ -63,7 +62,7 @@ class CComVariant : public tagVARIANT
[in] A pointer to the `VARIANT` whose value is converted to the new type. The default value is NULL, meaning the `CComVariant` object is converted in place.
185
+
[in] A pointer to the `VARIANT` whose value is converted to the new type. The default value is `NULL`, meaning the `CComVariant` object is converted in place.
187
186
188
187
### Return value
189
188
@@ -270,7 +269,7 @@ The contents of the `VARIANT` referenced by *`pDest`* are automatically cleared
270
269
271
270
## <a name="getsize"></a> `CComVariant::GetSize`
272
271
273
-
For simple-fixed size VARIANTs, this method returns the **`sizeof`** value for the underlying data type plus `sizeof(VARTYPE)`.
272
+
For simple-fixed size `VARIANT`s, this method returns the **`sizeof`** value for the underlying data type plus `sizeof(VARTYPE)`.
274
273
275
274
```cpp
276
275
ULONG GetSize() const;
@@ -282,9 +281,9 @@ The size in bytes of the current contents of the `CComVariant` object.
282
281
283
282
### Remarks
284
283
285
-
If the `VARIANT` contains an interface pointer, `GetSize` queries for `IPersistStream` or `IPersistStreamInit`. If successful, the return value is the low-order 32 bits of the value returned by `GetSizeMax` plus `sizeof(CLSID)` and `sizeof(VARTYPE)`. If the interface pointer is NULL, `GetSize` returns `sizeof(CLSID)` plus `sizeof(VARTYPE)`. If the total size is larger than `ULONG_MAX`, `GetSize` returns `sizeof(VARTYPE)`, which indicates an error.
284
+
If the `VARIANT` contains an interface pointer, `GetSize` queries for `IPersistStream` or `IPersistStreamInit`. If successful, the return value is the low-order 32 bits of the value returned by `GetSizeMax` plus `sizeof(CLSID)` and `sizeof(VARTYPE)`. If the interface pointer is `NULL`, `GetSize` returns `sizeof(CLSID)` plus `sizeof(VARTYPE)`. If the total size is larger than `ULONG_MAX`, `GetSize` returns `sizeof(VARTYPE)`, which indicates an error.
286
285
287
-
In all other cases, a temporary `VARIANT` of type `VT_BSTR` is coerced from the current `VARIANT`. The length of this `BSTR` is calculated as the size of the length of the string plus the length of the string itself plus the size of the null character plus `sizeof(VARTYPE)`. If the `VARIANT`cannot be coerced to a `VARIANT` of type `VT_BSTR`, `GetSize` returns `sizeof(VARTYPE)`.
286
+
In all other cases, a temporary `VARIANT` of type `VT_BSTR` is coerced from the current `VARIANT`. The length of this `BSTR` is calculated as the size of the length of the string plus the length of the string itself plus the size of the `NULL` character plus `sizeof(VARTYPE)`. If the `VARIANT`can’t be coerced to a `VARIANT` of type `VT_BSTR`, `GetSize` returns `sizeof(VARTYPE)`.
288
287
289
288
The size returned by this method matches the number of bytes used by [`CComVariant::WriteToStream`](#writetostream) under successful conditions.
@@ -135,7 +135,7 @@ Then, use compiler option `/analyze:plugin EspXEngine.dll` to use the EspXEngine
135
135
136
136
#### External file analysis options
137
137
138
-
Starting in Visual Studio 2019 version 16.10, you can specify different analysis rules and behavior for external headers. By using the **`/external:I`**, **`/external:env`**, or **`/external:anglebrackets`** options, directories can be specified as "external" directories. Any files that are included by using `#include`from an external directory or one of its subdirectories are considered as external headers. For more information, see [`/external` (External headers diagnostics)](external-external-headers-diagnostics.md).
138
+
Starting in Visual Studio 2019 version 16.10, you can specify different analysis rules and behavior for external headers. Use the **`/external:I`**, **`/external:env`**, or **`/external:anglebrackets`** options to specify directories as "external" directories. Any files that are included by using `#include`from an external directory or its subdirectories are considered as external headers. For more information, see [`/external` (External headers diagnostics)](external-external-headers-diagnostics.md).
139
139
140
140
Code analysis provides these options to control analysis of external files:
141
141
@@ -206,14 +206,14 @@ Specifies the current project directory. If the ruleset (or an item it includes)
206
206
Specifies a semicolon-separated list of ruleset search paths. If the ruleset (or an item it includes) is a file name, then the compiler first looks for the file under the *`project_directory`* specified by **`/analyze:projectdirectory`**, if any, followed by the specified *`ruleset_directories`*. This option is available starting in Visual Studio 2019 version 16.9.
207
207
208
208
**`/analyze:ruleset`***`ruleset_files`*\
209
-
Specifies one or more ruleset files to use for analysis. This option can make analysis more efficient. That's because the analysis engine tries to exclude checkers that have no active rules specified in the ruleset files before running. Otherwise, the engine runs all checkers enabled.
209
+
Specifies one or more ruleset files to use for analysis. This option can make analysis more efficient; the analysis engine tries to exclude checkers that have no active rules specified in the ruleset files before running. Otherwise, the engine runs all checkers enabled.
210
210
211
211
::: moniker-end
212
212
213
213
::: moniker range="msvc-150"
214
214
215
215
**`/analyze:ruleset`***`ruleset_file`*\
216
-
Specifies a ruleset file to use for analysis. This option can make analysis more efficient. That's because the analysis engine tries to exclude checkers that have no active rules specified in the ruleset file before running. Otherwise, the engine runs all checkers enabled.
216
+
Specifies a ruleset file to use for analysis. This option can make analysis more efficient; the analysis engine tries to exclude checkers that have no active rules specified in the ruleset file before running. Otherwise, the engine runs all checkers enabled.
217
217
218
218
::: moniker-end
219
219
@@ -267,6 +267,26 @@ For more information, see [Code analysis for C/C++ overview](../../code-quality/
267
267
268
268
1. Modify one or more of the **Code Analysis** properties.
269
269
270
+
1. Choose **OK** or **Apply** to save your changes.
271
+
272
+
::: moniker range=">=msvc-160"
273
+
274
+
To set external file analysis options in Visual Studio 2019 version 16.10 and later:
275
+
276
+
1. Open the project's **Property Pages** dialog box.
@@ -13,15 +14,37 @@ The following property pages are found under **Project** > **Properties** > **Co
13
14
14
15
### Additional Include Directories
15
16
16
-
Specifies one or more directories to add to the include path; separate with semi-colons if more than one. Sets [`/I` (Additional include directories)](i-additional-include-directories.md).
17
+
Specifies one or more directories to add to the include path. Separate directories with semi-colons ('`;`') if there's more than one. Sets the [`/I` (Additional include directories)](i-additional-include-directories.md) compiler option.
17
18
18
19
### Additional #using Directories
19
20
20
-
Specifies one or more directories (separate directory names with a semicolon) to be searched to resolve names passed to a #using directive. Sets [`/AI`](ai-specify-metadata-directories.md).
21
+
Specifies one or more directories to search to resolve names passed to a `#using` directive. Separate directories with semi-colons ('`;`') if there's more than one. Sets the [`/AI`](ai-specify-metadata-directories.md) compiler option.
22
+
23
+
### Additional BMI Directories
24
+
25
+
Specifies one or more directories to search to resolve names passed to an `import` directive. Separate directories with semi-colons ('`;`') if there's more than one. Sets the **`/ifcSearchDir[path]`** compiler option.
26
+
27
+
### Additional Module Dependencies
28
+
29
+
Specifies one or more modules to use to resolve names passed to an `import` directive. Separate directories with semi-colons ('`;`') if there's more than one. Sets the [`/reference`](module-reference.md) compiler option.
30
+
31
+
### Additional Header Unit Dependencies
32
+
33
+
Specifies one or more header units to use to resolve names passed to an `import` header directive. Separate directories with semi-colons ('`;`') if there's more than one. Sets the [`/headerUnit`](headerunit.md) compiler option.
34
+
35
+
### Scan Sources for Module Dependencies
36
+
37
+
When set to **Yes**, the compiler scans all C++ sources, not just module interface and header unit sources, for module and header units dependencies. The build system builds the full dependencies graph, which ensures that all imported modules and header units are built before compiling the files that depend on them. When combined with **Translate Includes to Imports**, any header file that's specified in a [`header-units.json`](header-unit-json-reference.md) file in the same directory as the header file is compiled into a header unit.
38
+
39
+
Files that have the extension *`.ixx`*, and files that have their **File properties** > **C/C++** > **Compile As** property set to **Compile as C++ Header Unit (/export)**, are always scanned.
40
+
41
+
### Translate Includes to Imports
42
+
43
+
When set to **Yes**, the compiler treats a `#include` directive as an `import` directive if certain conditions are met: The header file is specified in a *`header-units.json`* file in the same directory, and a compiled header unit (an *`.ifc`* file) is available for the header file. Otherwise, the header file is treated as a normal `#include`. The *`header-units.json`* file is used to build header units for each `#include` without symbol duplication. When combined with **Scan Sources for Module Dependencies**, the compiler automatically finds all of the header files that can be compiled into header units. This property sets the [`/translateInclude`](translateinclude.md) compiler option.
21
44
22
45
### Debug Information Format
23
46
24
-
Specifies the type of debugging information generated by the compiler. This property requires compatible linker settings. Sets [`/Z7`, `/Zi`, `/ZI` (Debug information format)](z7-zi-zi-debug-information-format.md).
47
+
Specifies the type of debugging information generated by the compiler. This property requires compatible linker settings. Sets [`/Z7`, `/Zi`, `/ZI` (Debug information format)](z7-zi-zi-debug-information-format.md) compiler options.
25
48
26
49
#### Choices
27
50
@@ -90,7 +113,11 @@ Additional Security Development Lifecycle (SDL) recommended checks; includes ena
90
113
91
114
### Multi-processor Compilation
92
115
93
-
Multi-processor Compilation.
116
+
Enable multi-processor compilation. Sets the [`/MP`](mp-build-with-multiple-processes.md) compiler option.
117
+
118
+
### Enable Address Sanitizer
119
+
120
+
Compiles and links the program with AddressSanitizer instrumentation. This property currently supports x86 and x64 target builds. Sets the [`/fsanitize`](fsanitize.md) compiler option.
94
121
95
122
## C/C++ Optimization Properties
96
123
@@ -280,7 +307,7 @@ Sets the floating point model. Sets [`/fp:precise`, `/fp:strict`, `/fp:fast`](fp
280
307
281
308
-**Precise** - Default. Improves the consistency of floating-point tests for equality and inequality.
282
309
-**Strict** - The strictest floating-point model. **`/fp:strict`** causes **`fp_contract`** to be OFF and **`fenv_access`** to be ON. **`/fp:except`** is implied and can be disabled by explicitly specifying **`/fp:except-`**. When used with **`/fp:except-`**, **`/fp:strict`** enforces strict floating-point semantics but without respect for exceptional events.
283
-
-**Fast** - Creates the fastest code in the majority of cases.
310
+
-**Fast** - Creates the fastest code in most cases.
284
311
285
312
### Enable Floating Point Exceptions
286
313
@@ -421,6 +448,28 @@ Specifies level of browse information in *`.bsc`* file. Sets [`/FR`](fr-fr-creat
421
448
422
449
Specifies optional name for browser information file. Sets [`/FR`\<name>](fr-fr-create-dot-sbr-file.md).
423
450
451
+
## External Includes
452
+
453
+
### Treat Files Included with Angle Brackets as External
454
+
455
+
Specifies whether to treat files included with angle brackets as external. Set this property to **Yes** to set the [`/external:anglebrackets`](external-external-headers-diagnostics.md) compiler option.
456
+
457
+
### External Header Warning Level
458
+
459
+
Select how strict you want the compiler to be about code errors in external headers. This property sets the [`/external:Wn`](external-external-headers-diagnostics.md) compiler option. If this value is set to **Inherit Project Warning Level** or the default, other **`/external`** options are ignored.
460
+
461
+
### Template Diagnostics in External Headers
462
+
463
+
Specifies whether to evaluate the warning level across a template instantiation chain. Set this property to **Yes** to set the [`/external:templates-`](external-external-headers-diagnostics.md) compiler option.
464
+
465
+
### Disable Code Analysis for External Headers
466
+
467
+
Disables code analysis for external headers. Sets the [`/analyze:external-`](analyze-code-analysis.md) compiler option.
468
+
469
+
### Analysis Ruleset for External Headers
470
+
471
+
Specifies a code analysis ruleset override for external headers. If not specified, the Code Analysis setting is used. Sets the [`/analyze:external:ruleset path`](analyze-code-analysis.md) compiler option.
0 commit comments