Skip to content

Commit 7dd4ac9

Browse files
Merge pull request #6070 from MicrosoftDocs/main
Auto Publish – main to live - 2025-09-05 17:30 UTC
2 parents 917caea + 2f52823 commit 7dd4ac9

35 files changed

+186
-129
lines changed

docs/dotnet/dotnet-programming-with-cpp-cli-visual-cpp.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ helpviewer_keywords: ["programming [C++], .NET programming", ".NET Framework [C+
66
---
77
# .NET programming with C++/CLI
88

9+
> [!IMPORTANT]
10+
> C++/CLI is a technology designed during the early years of .NET (2003–2010) and remains supported for compatibility purposes. It's best suited for existing codebases, particularly those being brought forward from .NET Framework to .NET Core, or for maintaining large legacy systems that are unlikely to evolve beyond .NET Framework.
11+
>
12+
> While C++/CLI is reliable and robust, no new feature work is planned beyond what's necessary to ensure continued functionality. Developers should be aware that using C++/CLI pessimizes both C++ and .NET languages, as it's constrained by the language features and APIs available at the time of its design—that is, prior to ISO C++11 and .NET Core. C++/CLI was designed based on C++98, and its [ECMA standard](https://ecma-international.org/publications-and-standards/standards/ecma-372) hasn't been updated to keep up with newer C++ standards since C++11. While some features in C++11 were incorporated, many features from more recent standards, like C++20 and C++23, have no direct support in C++/CLI for compilation to managed code. For more information, see [C++20 Support Comes To C++/CLI](https://devblogs.microsoft.com/cppblog/cpp20-support-comes-to-cpp-cli/).
13+
>
14+
> For new projects, we recommend exploring modern third-party alternatives such as <https://github.com/dotnet/ClangSharp> or <https://www.swig.org/>, which offer more flexibility and better alignment with current language and runtime capabilities.
15+
916
C++/CLI supplanted Managed C++. C++/CLI is a language specification created by Microsoft that extends C++ to support .NET. It's only supported on Windows. It's not for writing [WinUI](/windows/apps/winui) or Universal Windows Platform [UWP](/windows/uwp/get-started/universal-application-platform-guide) Windows Runtime (WinRT) apps. It's for writing .NET applications and components that run on .NET. C++/CLI is a bridge between native C++ code and managed code. It allows you to use existing C++ libraries in .NET applications and to write new .NET applications in C++.
1017

1118
Microsoft provides C++/WinRT for writing WinUI and WinRT apps. It's an entirely standard modern C++17 language projection for Windows Runtime (WinRT) APIs. For more information about using C++ with the Windows Runtime (WinRT), see [C++/WinRT](/windows/uwp/cpp-and-winrt-apis/).
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
description: "Learn more about: Compiler Error C2322"
32
title: "Compiler Error C2322"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2322"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2322"]
66
helpviewer_keywords: ["C2322"]
7-
ms.assetid: f9b92005-618a-42d8-80e9-67ce769a9f3b
87
---
98
# Compiler Error C2322
109

11-
'identifier' : address of dllimport 'dllimport' is not static
10+
> 'identifier' : address of dllimport 'dllimport' is not static
11+
12+
## Remarks
1213

1314
A nonstatic value is given as the address of a function declared with `dllimport`.

docs/error-messages/compiler-errors-1/compiler-error-c2323.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
---
22
title: "Compiler Error C2323"
33
description: "Learn more about: Compiler Error C2323"
4-
ms.date: "03/20/2024"
4+
ms.date: 03/20/2024
55
f1_keywords: ["C2323"]
66
helpviewer_keywords: ["C2323"]
77
---
88
# Compiler Error C2323
99

10-
'identifier': non-member operator `new` or `delete` functions may not be declared `static` or in a namespace other than the global namespace.
10+
> 'identifier': non-member operator `new` or `delete` functions may not be declared `static` or in a namespace other than the global namespace.
11+
12+
## Remarks
1113

1214
The `new` and `delete` overload operators must be non-static, defined in the global namespace or as class members.
1315

16+
## Example
17+
1418
The following generates C2323:
1519

1620
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2324.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2324"
32
title: "Compiler Error C2324"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2324"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2324"]
66
helpviewer_keywords: ["C2324"]
7-
ms.assetid: 215f0544-85b0-452d-825f-17a388b6a61c
87
---
98
# Compiler Error C2324
109

11-
'identifier' : unexpected to the right of 'name'
10+
> 'identifier' : unexpected to the right of 'name'
11+
12+
## Remarks
1213

1314
A destructor is called using an incorrect identifier.
1415

15-
The following sample generates C2324:
16+
## Example
17+
18+
The following example generates C2324:
1619

1720
```cpp
1821
// C2324.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2325.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2325"
32
title: "Compiler Error C2325"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2325"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2325"]
66
helpviewer_keywords: ["C2325"]
7-
ms.assetid: e6b0a186-3f2a-4adf-beae-fadd75492bf7
87
---
98
# Compiler Error C2325
109

11-
'type' : unexpected type to the right of 'name'
10+
> 'type' : unexpected type to the right of 'name'
11+
12+
## Remarks
1213

1314
A call is made to a destructor of incorrect type.
1415

15-
The following sample generates C2325:
16+
## Example
17+
18+
The following example generates C2325:
1619

1720
```cpp
1821
// C2325.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2326.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2326"
32
title: "Compiler Error C2326"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2326"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2326"]
66
helpviewer_keywords: ["C2326"]
7-
ms.assetid: 01a5ea40-de83-4e6f-a4e8-469f441258e0
87
---
98
# Compiler Error C2326
109

11-
'declarator' : function cannot access 'name'
10+
> 'declarator' : function cannot access 'name'
11+
12+
## Remarks
1213

1314
The code tries to modify a member variable, which is not possible.
1415

1516
## Example
1617

17-
The following sample generates C2326:
18+
The following example generates C2326:
1819

1920
```cpp
2021
// C2326.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2327.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C2327"
32
title: "Compiler Error C2327"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2327"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2327"]
66
helpviewer_keywords: ["C2327"]
7-
ms.assetid: 95278c95-d1f9-4487-ad27-53311f5e8112
87
---
98
# Compiler Error C2327
109

11-
'symbol' : is not a type name, static, or enumerator
10+
> 'symbol' : is not a type name, static, or enumerator
11+
12+
## Remarks
1213

1314
Code within a nested class attempts to access a member of the enclosing class that is not a type name, a static member, or an enumerator.
1415

1516
When compiling with **/clr**, a common cause for C2327 is a property with the same name as the property type.
1617

17-
The following sample generates C2327:
18+
## Examples
19+
20+
The following example generates C2327:
1821

1922
```cpp
2023
// C2327.cpp
@@ -62,7 +65,7 @@ struct B {
6265
};
6366
```
6467
65-
The following sample generates C2327:
68+
The following example generates C2327:
6669
6770
```cpp
6871
// C2327d.cpp
@@ -96,7 +99,7 @@ namespace NA {
9699
}
97100
```
98101

99-
The following sample shows C2327 when a property has the same name as the property type:
102+
The following example shows C2327 when a property has the same name as the property type:
100103

101104
```cpp
102105
// C2327f.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2332.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2332"
32
title: "Compiler Error C2332"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2332"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2332"]
66
helpviewer_keywords: ["C2332"]
7-
ms.assetid: fb05cd68-e271-4bea-9fb7-ef4edb0a26ac
87
---
98
# Compiler Error C2332
109

11-
'typedef' : missing tag name
10+
> 'typedef' : missing tag name
11+
12+
## Remarks
1213

1314
The compiler found an incomplete type definition.
1415

15-
The following sample generates C2332:
16+
## Example
17+
18+
The following example generates C2332:
1619

1720
```cpp
1821
// C2332.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2333.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2333"
32
title: "Compiler Error C2333"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2333"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2333"]
66
helpviewer_keywords: ["C2333"]
7-
ms.assetid: 2636fc1e-d3e7-4e68-8628-3c81a99ba813
87
---
98
# Compiler Error C2333
109

11-
'function' : error in function declaration; skipping function body
10+
> 'function' : error in function declaration; skipping function body
11+
12+
## Remarks
1213

1314
This error occurs after another error, for member functions defined inside their class.
1415

15-
The following sample generates C2333:
16+
## Example
17+
18+
The following example generates C2333:
1619

1720
```cpp
1821
// C2333.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2334.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
2-
description: "Learn more about: Compiler Error C2334"
32
title: "Compiler Error C2334"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2334"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2334"]
66
helpviewer_keywords: ["C2334"]
7-
ms.assetid: 36142855-e00b-4bbf-80f5-a301edeff46e
87
---
98
# Compiler Error C2334
109

11-
unexpected token(s) preceding ': or {'; skipping apparent function body
10+
> unexpected token(s) preceding ': or {'; skipping apparent function body
11+
12+
## Example
1213

13-
The following sample generates C2334. This error occurs after error C2059:
14+
The following example generates C2334. This error occurs after error C2059:
1415

1516
```cpp
1617
// C2334.cpp

0 commit comments

Comments
 (0)