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/windows/walkthrough-creating-a-standard-cpp-program-cpp.md
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -31,14 +31,20 @@ To complete this walkthrough, you must understand the fundamentals of the C++ la
31
31
32
32
1. Create a project by pointing to **New** on the **File** menu, and then clicking **Project**.
33
33
34
-
1. In the **Visual C++** project types pane, click **Windows Desktop**, and then click **Windows Console Application**.
34
+
1. In the **Visual C++** project types pane, click **Windows Desktop**, and then click **Windows Console Application**.
35
35
36
-
1. Type a name for the project.
36
+
> [!NOTE]
37
+
> For versions of Visual Studio older than 2017, in the **New Project** dialog box, expand **Installed** > **Templates** > **Visual C++**, and then select **Win32**. In the center pane, select **Win32 Console Application**.
38
+
39
+
Type a name for the project.
37
40
38
41
By default, the solution that contains the project has the same name as the project, but you can type a different name. You can also type a different location for the project.
39
42
40
43
Click **OK** to create the project.
41
44
45
+
> [!NOTE]
46
+
> For versions of Visual Studio older than 2017, complete the **Win32 Application Wizard**. Click **Next**, then make sure **Console Application** is selected and uncheck the **Precompiled Headers** box. Click **Finish**.
47
+
42
48
1. If **Solution Explorer** is not displayed, on the **View** menu, click **Solution Explorer**.
43
49
44
50
1. Add a new source file to the project, as follows.
Copy file name to clipboardExpand all lines: docs/windows/walkthrough-creating-and-using-a-static-library-cpp.md
+28-10Lines changed: 28 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -37,17 +37,26 @@ An understanding of the fundamentals of the C++ language.
37
37
38
38
1. On the menu bar, choose **File** > **New** > **Project**.
39
39
40
-
1. In the left pane of the **New Project** dialog box, expand **Installed** > **Visual C++**, and then select **Windows Desktop**.
40
+
1. In the left pane of the **New Project** dialog box, expand **Installed** > **Visual C++**, and then select **Windows Desktop**. In the center pane, select **Windows Desktop Wizard**.
41
41
42
-
1. In the center pane, select **Windows Desktop Wizard**.
42
+
> [!NOTE]
43
+
> For versions of Visual Studio older than 2017, in the **New Project** dialog box, expand **Installed** > **Templates** > **Visual C++**, and then select **Win32**. In the center pane, select **Win32 Console Application**.
43
44
44
45
1. Specify a name for the project—for example, *MathFuncsLib*—in the **Name** box. Specify a name for the solution—for example, *StaticLibrary*—in the **Solution Name** box. Choose the **OK** button.
45
46
46
-
1. Under **Application type**, select Static Library (.lib).
47
+
- For Visual Studio 2017,
48
+
49
+
1. Under **Application type**, select **Static Library (.lib)**.
50
+
51
+
1. Under **Additioal Options**, un-check the **Precompiled header** check box.
52
+
53
+
1. Choose **OK** to create the project.
54
+
55
+
- For versions of Visual Studio older than 2017,
47
56
48
-
1. Under **Additional Options**, un-check the **Precompiled header** check box.
57
+
1. Click **Next**.
49
58
50
-
1.Choose**OK** to create the project.
59
+
1.Under**Application type**, select **Static library**. Then uncheck the **Precompiled header** box and choose **Finish**.
51
60
52
61
## <aname="AddClassToLib"></a> Adding a class to the static library
53
62
@@ -76,17 +85,26 @@ An understanding of the fundamentals of the C++ language.
76
85
77
86
1. On the menu bar, choose **File** > **New** > **Project**.
78
87
79
-
1. In the left pane of the **New Project** dialog box, expand **Installed** > **Visual C++**, and then select **Windows Desktop**.
88
+
1. In the left pane of the **New Project** dialog box, expand **Installed** > **Visual C++**, and then select **Windows Desktop**. In the center pane, select **Windows Desktop Wizard**.
80
89
81
-
1. In the center pane, select **Windows Desktop Wizard**.
90
+
> [!NOTE]
91
+
> For versions of Visual Studio older than 2017, in the **New Project** dialog box, expand **Installed** > **Templates** > **Visual C++**, and then select **Win32**. In the center pane, select **Win32 Console Application**.
82
92
83
93
1. Specify a name for the project—for example, *MyExecRefsLib*—in the **Name** box. In the drop-down list next to **Solution**, select **Add to Solution**. This adds the new project to the solution that contains the static library. Choose the **OK** button.
84
94
85
-
1. Under **Application type**, select **Console Application (.exe)**.
95
+
- For Visual Studio 2017,
96
+
97
+
1. Under **Application type**, select **Console Application (.exe)**.
98
+
99
+
1. Under **Additioal Options**, un-check the **Precompiled header** check box.
100
+
101
+
1. Choose **OK** to create the project.
102
+
103
+
- For versions of Visual Studio older than 2017,
86
104
87
-
1. Under **Additioal Options**, un-check the **Precompiled header** check box.
105
+
1. Click **Next**.
88
106
89
-
1.Choose **OK**to create the project.
107
+
1.Make sure **Console application**is selected. Then check the **Empty Project** box and choose **Finish**.
90
108
91
109
## <aname="UseLibInApp"></a> Using the functionality from the static library in the app
Copy file name to clipboardExpand all lines: docs/windows/walkthrough-creating-windows-desktop-applications-cpp.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ Next, you'll learn how to create the code for a Windows desktop application in V
107
107
For information about the parameters and return value of this function, see [WinMain entry point](https://msdn.microsoft.com/library/windows/desktop/ms633559).
108
108
109
109
> [!NOTE]
110
-
> What are all those extra words, such as `CALLBACK`, or `HINSTANCE`, or `_In_`? The traditional Windows API uses typedefs and preprocessor macros extensively to abstract away some of the details of types and platform-specific code, such as calling conventions, **__declspec** declarations, and compiler pragmas. In Visual Studio, you can use the IntelliSense [Quick Info](/visualstudio/ide/using-intellisense#quick-info) feature to see what these typedefs and macros define. Hover your mouse over the word of interest, or select it and press ctrl-K, ctrl-I for a small pop-up window that contains the definition. For more information, see [Using IntelliSense](/visualstudio/ide/using-intellisense). Parameters and return types often use *SAL Annotations* to help you catch programming errors. For more information, see [Using SAL Annotations to Reduce C/C++ Code Defects](/visualstudio/code-quality/using-sal-annotations-to-reduce-c-cpp-code-defects).
110
+
> What are all those extra words, such as `CALLBACK`, or `HINSTANCE`, or `_In_`? The traditional Windows API uses typedefs and preprocessor macros extensively to abstract away some of the details of types and platform-specific code, such as calling conventions, **__declspec** declarations, and compiler pragmas. In Visual Studio, you can use the IntelliSense [Quick Info](/visualstudio/ide/using-intellisense#quick-info) feature to see what these typedefs and macros define. Hover your mouse over the word of interest, or select it and press **Ctrl**+**K**, **Ctrl**+**I** for a small pop-up window that contains the definition. For more information, see [Using IntelliSense](/visualstudio/ide/using-intellisense). Parameters and return types often use *SAL Annotations* to help you catch programming errors. For more information, see [Using SAL Annotations to Reduce C/C++ Code Defects](/visualstudio/code-quality/using-sal-annotations-to-reduce-c-cpp-code-defects).
111
111
112
112
1. Windows desktop programs require <windows.h>. <tchar.h> defines the `TCHAR` macro, which resolves ultimately to **wchar_t** if the UNICODE symbol is defined in your project, otherwise it resolves to **char**. If you always build with UNICODE enabled, you don't need TCHAR and can just use **wchar_t** directly.
0 commit comments