Skip to content

Commit 9c10f6f

Browse files
TylerMSFTTylerMSFT
authored andcommitted
offer an alternative project type
1 parent d19962e commit 9c10f6f

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

docs/text/how-to-convert-between-various-string-types.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,22 @@ For more background information about converting narrow and wide strings, see [C
1717

1818
## Run the examples
1919

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).
2121

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**.
2329

2430
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:
2531

2632
- Turn off [Set Basic Runtime Checks to Default (/RTC1)](../build/reference/rtc-run-time-error-checks.md#to-set-this-compiler-option-in-the-visual-studio-development-environment): **Project Properties** > **C/C++** > **Code Generation** > **Basic Runtime Checks** > **Default**
2733
- Turn off [/EHS (Exception handling model)](../build/reference/eh-exception-handling-model.md#to-set-this-compiler-option-in-the-visual-studio-development-environment): **Project Properties** > **C/C++** > **Code Generation** > **Enable C++ Exceptions** > **No**
2834
- Exchange [/Zi (Debug information format)](../build/reference/z7-zi-zi-debug-information-format.md#to-set-this-compiler-option-in-the-visual-studio-development-environment) for [/Z7](/cpp/build/reference/z7-zi-zi-debug-information-format.md#to-set-this-compiler-option-in-the-visual-studio-development-environment): **Project Properties** > **C/C++** > **General** > **Debug Information Format** > **C7 compatible**.
2935
- Turn off [/JMC (Just My Code debugging)](../build/reference/jmc.md#to-set-this-compiler-option-in-the-visual-studio-development-environment): **Project Properties** > **C/C++** > **General** > **Support Just My Code Debugging** > **No**
30-
31-
Add `comsuppw.lib`, to **Project Properties** > **Linker** > **Input** > **Additional Dependencies**.
32-
33-
To debug the samples:
34-
3536
- Set the debugger type to mixed: **Project Properties** > **Debugging** > **Debugger Type** > **Mixed (.NET framework)**
3637
- Turn on [/ASSEMBLYDEBUG](/cpp/build/reference/assemblydebug-add-debuggableattribute.md#to-set-this-linker-option-in-the-visual-studio-development-environment): **Project properties** > **Linker** > **Debugging** > **Debuggable Assembly** > **Yes (ASSEMBLYDEBUG)**
3738

0 commit comments

Comments
 (0)