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
Copy file name to clipboardExpand all lines: docs/preprocessor/make-public.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,26 +22,26 @@ Indicates that a native type should have public assembly accessibility.
22
22
```
23
23
24
24
### Parameters
25
-
`type` is the name of the type you want to have public assembly accessibility.
25
+
*type* is the name of the type you want to have public assembly accessibility.
26
26
27
27
## Remarks
28
-
`make_public` is useful for when the native type you want to reference is from a .h file that you cannot change. If you want to use the native type in the signature of a public function in a type with public assembly visibility, the native type must also have public assembly accessibility or the compiler will issue a warning.
28
+
29
+
**make_public** is useful for when the native type you want to reference is from a .h file that you cannot change. If you want to use the native type in the signature of a public function in a type with public assembly visibility, the native type must also have public assembly accessibility or the compiler will issue a warning.
29
30
30
-
`make_public` must be specified at global scope and is only in effect from the point at which it is declared through to the end of the source code file.
31
+
**make_public** must be specified at global scope and is only in effect from the point at which it is declared through to the end of the source code file.
31
32
32
33
The native type may be implicitly or explicitly private; see [Type Visibility](../dotnet/how-to-define-and-consume-classes-and-structs-cpp-cli.md#BKMK_Type_visibility) for more information.
33
34
34
-
## Example
35
+
## Examples
35
36
The following sample is the contents of a .h file that contains the definitions for two native structs.
36
37
37
38
```cpp
38
39
// make_public_pragma.h
39
40
structNative_Struct_1 { int i; };
40
41
struct Native_Struct_2 { int i; };
41
42
```
42
-
43
-
## Example
44
-
The following code sample consumes the header file and shows that unless you explicitly mark the native structs as public, using `make_public`, the compiler will generate a warning when you attempt to use the native structs in the signature of public function in a public managed type.
43
+
44
+
The following code sample consumes the header file and shows that unless you explicitly mark the native structs as public, using **make_public**, the compiler will generate a warning when you attempt to use the native structs in the signature of public function in a public managed type.
45
45
46
46
```cpp
47
47
// make_public_pragma.cpp
@@ -56,5 +56,6 @@ public ref struct A {
56
56
};
57
57
```
58
58
59
-
## See Also
59
+
## See Also
60
+
60
61
[Pragma Directives and the __Pragma Keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
Copy file name to clipboardExpand all lines: docs/preprocessor/managed-unmanaged.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,31 +18,31 @@ Enable function-level control for compiling functions as managed or unmanaged.
18
18
## Syntax
19
19
20
20
```
21
-
22
-
#pragma managed
21
+
#pragma managed
23
22
#pragma unmanaged
24
23
#pragma managed([push,] on | off)
25
24
#pragma managed(pop)
26
25
```
27
26
28
27
## Remarks
29
-
The [/clr](../build/reference/clr-common-language-runtime-compilation.md) compiler option provides module-level control for compiling functions either as managed or unmanaged.
28
+
29
+
The [/clr](../build/reference/clr-common-language-runtime-compilation.md) compiler option provides module-level control for compiling functions either as managed or unmanaged.
30
30
31
-
An unmanaged function will be compiled for the native platform, and execution of that portion of the program will be passed to the native platform by the common language runtime.
31
+
An unmanaged function will be compiled for the native platform, and execution of that portion of the program will be passed to the native platform by the common language runtime.
32
32
33
-
Functions are compiled as managed by default when **/clr** is used.
33
+
Functions are compiled as managed by default when `/clr` is used.
34
34
35
-
When applying these pragmas:
35
+
When applying these pragmas:
36
36
37
-
-Add the pragma preceding a function but not within a function body.
37
+
- Add the pragma preceding a function but not within a function body.
38
38
39
-
-Add the pragma after `#include` statements. Do not use these pragmas before `#include` statements.
39
+
- Add the pragma after `#include` statements. Do not use these pragmas before `#include` statements.
40
40
41
-
The compiler ignores the `managed` and `unmanaged` pragmas if **/clr** is not used in the compilation.
41
+
The compiler ignores the **managed** and **unmanaged** pragmas if `/clr` is not used in the compilation.
42
42
43
-
When a template function is instantiated, the pragma state at the time of definition for the template determines if it is managed or unmanaged.
43
+
When a template function is instantiated, the pragma state at the time of definition for the template determines if it is managed or unmanaged.
44
44
45
-
For more information, see [Initialization of Mixed Assemblies](../dotnet/initialization-of-mixed-assemblies.md).
45
+
For more information, see [Initialization of Mixed Assemblies](../dotnet/initialization-of-mixed-assemblies.md).
46
46
47
47
## Example
48
48
@@ -81,4 +81,5 @@ In unmanaged function.
81
81
```
82
82
83
83
## See Also
84
-
[Pragma Directives and the __Pragma Keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
84
+
85
+
[Pragma Directives and the __Pragma Keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
Copy file name to clipboardExpand all lines: docs/preprocessor/message.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,20 +18,20 @@ Sends a string literal to the standard output without terminating the compilatio
18
18
## Syntax
19
19
20
20
```
21
-
22
21
#pragma message( messagestring )
23
22
```
24
23
25
24
## Remarks
26
-
A typical use of the **message** pragma is to display informational messages at compile time.
25
+
26
+
A typical use of the **message** pragma is to display informational messages at compile time.
27
27
28
-
The *messagestring* parameter can be a macro that expands to a string literal, and you can concatenate such macros with string literals in any combination.
28
+
The *messagestring* parameter can be a macro that expands to a string literal, and you can concatenate such macros with string literals in any combination.
29
29
30
-
If you use a predefined macro in the **message** pragma, the macro should return a string, else you will have to convert the output of the macro to a string.
30
+
If you use a predefined macro in the **message** pragma, the macro should return a string, else you will have to convert the output of the macro to a string.
31
31
32
-
The following code fragment uses the **message** pragma to display messages during compilation:
32
+
The following code fragment uses the **message** pragma to display messages during compilation:
33
33
34
-
```
34
+
```cpp
35
35
// pragma_directives_message1.cpp
36
36
// compile with: /LD
37
37
#if _M_IX86 >= 500
@@ -55,4 +55,5 @@ Sends a string literal to the standard output without terminating the compilatio
55
55
```
56
56
57
57
## See Also
58
-
[Pragma Directives and the __Pragma Keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
58
+
59
+
[Pragma Directives and the __Pragma Keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
Copy file name to clipboardExpand all lines: docs/preprocessor/named-guids.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.workload: ["cplusplus"]
15
15
# named_guids
16
16
**C++ Specific**
17
17
18
-
Tells the compiler to define and initialize GUID variables in old style, of the form **LIBID_MyLib**, **CLSID_MyCoClass**, **IID_MyInterface**, and **DIID_MyDispInterface**.
18
+
Tells the compiler to define and initialize GUID variables in old style, of the form `LIBID_MyLib`, `CLSID_MyCoClass`, `IID_MyInterface`, and `DIID_MyDispInterface`.
Copy file name to clipboardExpand all lines: docs/preprocessor/no-auto-exclude.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.workload: ["cplusplus"]
15
15
# no_auto_exclude
16
16
**C++ Specific**
17
17
18
-
Disables automatic exclusion.
18
+
Disables automatic exclusion.
19
19
20
20
## Syntax
21
21
@@ -24,10 +24,12 @@ no_auto_exclude
24
24
```
25
25
26
26
## Remarks
27
-
Type libraries may include definitions of items defined in system headers or other type libraries. `#import` attempts to avoid multiple definition errors by automatically excluding such items. When this is done, [Compiler Warning (level 3) C4192](../error-messages/compiler-warnings/compiler-warning-level-3-c4192.md) will be issued for each item to be excluded. You can disable this automatic exclusion by using this attribute.
27
+
28
+
Type libraries may include definitions of items defined in system headers or other type libraries. `#import` attempts to avoid multiple definition errors by automatically excluding such items. When this is done, [Compiler Warning (level 3) C4192](../error-messages/compiler-warnings/compiler-warning-level-3-c4192.md) will be issued for each item to be excluded. You can disable this automatic exclusion by using this attribute.
Copy file name to clipboardExpand all lines: docs/preprocessor/no-dual-interfaces.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.workload: ["cplusplus"]
15
15
# no_dual_interfaces
16
16
**C++ Specific**
17
17
18
-
Changes the way the compiler generates wrapper functions for dual interface methods.
18
+
Changes the way the compiler generates wrapper functions for dual interface methods.
19
19
20
20
## Syntax
21
21
@@ -24,10 +24,12 @@ no_dual_interfaces
24
24
```
25
25
26
26
## Remarks
27
-
Normally, the wrapper will call the method through the virtual function table for the interface. With `no_dual_interfaces`, the wrapper instead calls **IDispatch::Invoke** to invoke the method.
27
+
28
+
Normally, the wrapper will call the method through the virtual function table for the interface. With **no_dual_interfaces**, the wrapper instead calls `IDispatch::Invoke` to invoke the method.
Copy file name to clipboardExpand all lines: docs/preprocessor/no-implementation.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.workload: ["cplusplus"]
15
15
# no_implementation
16
16
**C++ Specific**
17
17
18
-
Suppresses the generation of the .tli header, which contains the implementations of the wrapper member functions.
18
+
Suppresses the generation of the .tli header, which contains the implementations of the wrapper member functions.
19
19
20
20
## Syntax
21
21
@@ -24,12 +24,14 @@ no_implementation
24
24
```
25
25
26
26
## Remarks
27
-
If this attribute is specified, the .tlh header, with the declarations to expose type-library items, will be generated without an `#include` statement to include the .tli header file.
27
+
28
+
If this attribute is specified, the .tlh header, with the declarations to expose type-library items, will be generated without an `#include` statement to include the .tli header file.
28
29
29
-
This attribute is used in conjunction with [implementation_only](../preprocessor/implementation-only.md).
30
+
This attribute is used in conjunction with [implementation_only](../preprocessor/implementation-only.md).
Copy file name to clipboardExpand all lines: docs/preprocessor/no-namespace.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.workload: ["cplusplus"]
15
15
# no_namespace
16
16
**C++ Specific**
17
17
18
-
Specifies that the namespace name is not generated by the compiler.
18
+
Specifies that the namespace name is not generated by the compiler.
19
19
20
20
## Syntax
21
21
@@ -24,12 +24,14 @@ no_namespace
24
24
```
25
25
26
26
## Remarks
27
-
The type-library contents in the `#import` header file are normally defined in a namespace. The namespace name is specified in the **library** statement of the original IDL file. If the `no_namespace` attribute is specified, then this namespace is not generated by the compiler.
27
+
28
+
The type-library contents in the `#import` header file are normally defined in a namespace. The namespace name is specified in the `library` statement of the original IDL file. If the **no_namespace** attribute is specified, then this namespace is not generated by the compiler.
28
29
29
-
If you want to use a different namespace name, then use the [rename_namespace](../preprocessor/rename-namespace.md) attribute instead.
30
+
If you want to use a different namespace name, then use the [rename_namespace](../preprocessor/rename-namespace.md) attribute instead.
Copy file name to clipboardExpand all lines: docs/preprocessor/no-registry.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,28 +13,29 @@ ms.author: "corob"
13
13
ms.workload: ["cplusplus"]
14
14
---
15
15
# no_registry
16
-
`no_registry` tells the compiler not to search the registry for type libraries imported with `#import`.
16
+
**no_registry** tells the compiler not to search the registry for type libraries imported with `#import`.
17
17
18
18
## Syntax
19
19
20
20
```
21
-
22
21
#import filename no_registry
23
22
```
24
23
25
-
####Parameters
26
-
*filename*
27
-
A type library.
24
+
### Parameters
25
+
*filename*
26
+
A type library.
28
27
29
28
## Remarks
30
-
If a referenced type library is not found in the include directories, the compilation will fail even if the type library is in the registry. `no_registry` propagates to other type libraries implicitly imported with `auto_search`.
29
+
30
+
If a referenced type library is not found in the include directories, the compilation will fail even if the type library is in the registry. **no_registry** propagates to other type libraries implicitly imported with `auto_search`.
31
31
32
-
The compiler will never search the registry for type libraries that are specified by file name and passed directly to `#import`.
32
+
The compiler will never search the registry for type libraries that are specified by file name and passed directly to `#import`.
33
33
34
-
When `auto_search` is specified, the additional `#import`s will be generated with the `no_registry` setting of the initial `#import` (if the initial `#import` directive was `no_registry`, an `auto_search`-generated `#import` is also `no_registry`.)
34
+
When `auto_search` is specified, the additional `#import`s will be generated with the **no_registry** setting of the initial `#import` (if the initial `#import` directive was **no_registry**, an `auto_search`-generated `#import` is also **no_registry**.)
35
35
36
-
`no_registry` is useful if you want to import cross referenced type libraries without the risk of the compiler finding an older version of the file in the registry. `no_registry` is also useful if the type library is not registered.
36
+
**no_registry** is useful if you want to import cross referenced type libraries without the risk of the compiler finding an older version of the file in the registry. **no_registry** is also useful if the type library is not registered.
Copy file name to clipboardExpand all lines: docs/preprocessor/no-search-namespace.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.workload: ["cplusplus"]
15
15
# no_search_namespace
16
16
**C++ Specific**
17
17
18
-
Has the same functionality as the [no_namespace](../preprocessor/no-namespace.md) attribute but is used on type libraries that you use the #import directive with the [auto_search](../preprocessor/auto-search.md) attribute.
18
+
Has the same functionality as the [no_namespace](../preprocessor/no-namespace.md) attribute but is used on type libraries that you use the `#import` directive with the [auto_search](../preprocessor/auto-search.md) attribute.
0 commit comments