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/text/how-to-convert-between-various-string-types.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
@@ -17,21 +17,22 @@ For more background information about converting narrow and wide strings, see [C
17
17
18
18
## Run the examples
19
19
20
-
To run the examples in Visual Studio 2022, create a new C++ Windows Console App and copy the sample code into it. The Windows Console project type is available from the **Create a new project** dialog after setting the language dropdown to **C++**, the platform dropdown to **Windows**, and the platform dropdown to **All project types**.
20
+
To run the examples in Visual Studio 2022, you can either create a new C++ Windows Console App or, if you have installed C++/CLI support, you can create a CLR Console App (.NET Framework).
21
21
22
-
Add the `/clr` and `/Zc:twoPhase-` command line arguments to **Project Properties** > **C++** > **Command Line** > **Additional Options**.
22
+
If you create a CLR Console App, you don't have to make the following changes to the compiler and debugger settings. However, you'll need to add `#include "pch.h"` to the top of each example.
23
+
24
+
Either way, add `comsuppw.lib` to **Project Properties** > **Linker** > **Input** > **Additional Dependencies**.
25
+
26
+
If you create a new C++ Windows Console app to run the examples, make the following project changes:
27
+
28
+
- Add the `/clr` and `/Zc:twoPhase-` command line arguments to **Project Properties** > **C++** > **Command Line** > **Additional Options**.
23
29
24
30
The `/clr` switch conflicts with some compiler switches that are set when you create a C++ Windows Console App project. The following links provide instructions for where in the IDE you can turn off the conflicting switches:
0 commit comments