Skip to content

Commit 0bce44a

Browse files
author
mtx48109
committed
walkthrough review pr4
1 parent 5245f33 commit 0bce44a

3 files changed

Lines changed: 42 additions & 40 deletions

docs/windows/walkthrough-creating-a-standard-cpp-program-cpp.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Walkthrough: Creating a Standard C++ Program (C++) | Microsoft Docs"
33
ms.custom: "get-started-article"
4-
ms.date: "11/04/2016"
4+
ms.date: "09/18/2018"
55
ms.technology: ["cpp-windows"]
66
ms.topic: "conceptual"
77
f1_keywords: ["vcfirstapp", "vccreatefirst"]
@@ -31,41 +31,42 @@ To complete this walkthrough, you must understand the fundamentals of the C++ la
3131

3232
1. Create a project by pointing to **New** on the **File** menu, and then clicking **Project**.
3333

34-
2. 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**.
3535

36-
3. Type a name for the project.
36+
1. Type a name for the project.
3737

3838
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.
3939

4040
Click **OK** to create the project.
4141

42-
4. If **Solution Explorer** is not displayed, on the **View** menu, click **Solution Explorer**.
42+
1. If **Solution Explorer** is not displayed, on the **View** menu, click **Solution Explorer**.
4343

44-
5. Add a new source file to the project, as follows.
44+
1. Add a new source file to the project, as follows.
4545

4646
1. In **Solution Explorer**, right-click the **Source Files** folder, point to **Add**, and then click **New Item**.
4747

48-
2. In the **Code** node, click **C++ File (.cpp)**, type a name for the file, and then click **Add**.
48+
1. In the **Code** node, click **C++ File (.cpp)**, type a name for the file, and then click **Add**.
4949

5050
The .cpp file appears in the **Source Files** folder in **Solution Explorer**, and the file is opened in the Visual Studio editor.
5151

52-
6. In the file in the editor, type a valid C++ program that uses the C++ Standard Library, or copy one of the sample programs and paste it in the file.
52+
1. In the file in the editor, type a valid C++ program that uses the C++ Standard Library, or copy one of the sample programs and paste it in the file.
5353

54-
7. Save the file.
54+
1. Save the file.
5555

56-
8. On the **Build** menu, click **Build Solution**.
56+
1. On the **Build** menu, click **Build Solution**.
5757

5858
The **Output** window displays information about the compilation progress, for example, the location of the build log and a message that indicates the build status.
5959

60-
9. On the **Debug** menu, click **Start without Debugging**.
60+
1. On the **Debug** menu, click **Start without Debugging**.
6161

6262
If you used the sample program, a command window is displayed and shows whether certain integers are found in the set.
6363

6464
## Next Steps
6565

66-
**Previous:** [Console Applications in Visual C++](../windows/console-applications-in-visual-cpp.md). **Next:**[Walkthrough: Compiling a Native C++ Program on the Command Line](../build/walkthrough-compiling-a-native-cpp-program-on-the-command-line.md).
66+
**Previous:** [Console Applications in Visual C++](../windows/console-applications-in-visual-cpp.md)<br/>
67+
**Next:** [Walkthrough: Compiling a Native C++ Program on the Command Line](../build/walkthrough-compiling-a-native-cpp-program-on-the-command-line.md)<br/>
6768

6869
## See Also
6970

70-
[C++ Language Reference](../cpp/cpp-language-reference.md)
71-
[C++ Standard Library](../standard-library/cpp-standard-library-reference.md)
71+
[C++ Language Reference](../cpp/cpp-language-reference.md)<br/>
72+
[C++ Standard Library](../standard-library/cpp-standard-library-reference.md)<br/>

docs/windows/walkthrough-creating-and-using-a-static-library-cpp.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Walkthrough: Creating and Using a Static Library (C++) | Microsoft Docs"
33
ms.custom: "get-started-article"
4-
ms.date: "07/12/2018"
4+
ms.date: "09/18/2018"
55
ms.technology: ["cpp-windows"]
66
ms.topic: "conceptual"
77
dev_langs: ["C++"]
@@ -37,35 +37,35 @@ An understanding of the fundamentals of the C++ language.
3737

3838
1. On the menu bar, choose **File** > **New** > **Project**.
3939

40-
2. 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**.
4141

42-
3. In the center pane, select **Windows Desktop Wizard**.
42+
1. In the center pane, select **Windows Desktop Wizard**.
4343

44-
4. 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.
44+
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.
4545

46-
5. Under **Application type**, select Static Library (.lib).
46+
1. Under **Application type**, select Static Library (.lib).
4747

48-
6. Under **Additional Options**, un-check the **Precompiled header** check box.
48+
1. Under **Additional Options**, un-check the **Precompiled header** check box.
4949

50-
7. Choose **OK** to create the project.
50+
1. Choose **OK** to create the project.
5151

5252
## <a name="AddClassToLib"></a> Adding a class to the static library
5353

5454
### To add a class to the static library
5555

56-
1. To create a header file for a new class, open the shortcut menu for the **MathFuncsLib** project in **Solution Explorer**, and then choose **Add**, **New Item**. In the **Add New Item** dialog box, in the left pane, under **Visual C++**, select **Code**. In the center pane, select **Header File (.h)**. Specify a name for the header file—for example, *MathFuncsLib.h*—and then choose the **Add** button. A blank header file is displayed.
56+
1. To create a header file for a new class, open the shortcut menu for the **MathFuncsLib** project in **Solution Explorer**, and then choose **Add** > **New Item**. In the **Add New Item** dialog box, in the left pane, under **Visual C++**, select **Code**. In the center pane, select **Header File (.h)**. Specify a name for the header file—for example, *MathFuncsLib.h*—and then choose the **Add** button. A blank header file is displayed.
5757

58-
2. Add a class named `MyMathFuncs` to do common mathematical operations such as addition, subtraction, multiplication, and division. The code should resemble this:
58+
1. Add a class named `MyMathFuncs` to do common mathematical operations such as addition, subtraction, multiplication, and division. The code should resemble this:
5959

6060
[!code-cpp[NVC_Walkthrough_Create_Static_Lib#100](../windows/codesnippet/CPP/walkthrough-creating-and-using-a-static-library-cpp_1.h)]
6161

62-
3. To create a source file for the new class, open the shortcut menu for the **MathFuncsLib** project in **Solution Explorer**, and then choose **Add**, **New Item**. In the **Add New Item** dialog box, in the left pane, under **Visual C++**, select **Code**. In the center pane, select **C++ File (.cpp)**. Specify a name for the source file—for example, *MathFuncsLib.cpp*—and then choose the **Add** button. A blank source file is displayed.
62+
1. To create a source file for the new class, open the shortcut menu for the **MathFuncsLib** project in **Solution Explorer**, and then choose **Add** > **New Item**. In the **Add New Item** dialog box, in the left pane, under **Visual C++**, select **Code**. In the center pane, select **C++ File (.cpp)**. Specify a name for the source file—for example, *MathFuncsLib.cpp*—and then choose the **Add** button. A blank source file is displayed.
6363

64-
4. Use this source file to implement the functionality for **MyMathFuncs**. The code should resemble this:
64+
1. Use this source file to implement the functionality for **MyMathFuncs**. The code should resemble this:
6565

6666
[!code-cpp[NVC_Walkthrough_Create_Static_Lib#110](../windows/codesnippet/CPP/walkthrough-creating-and-using-a-static-library-cpp_2.cpp)]
6767

68-
5. Compile the static library by selecting **Build** > **Build Solution** on the menu bar. This creates a static library that can be used by other programs.
68+
1. Compile the static library by selecting **Build** > **Build Solution** on the menu bar. This creates a static library that can be used by other programs.
6969

7070
> [!NOTE]
7171
> When you build on the Visual Studio command line, you must build the program in two steps. First, run `cl /c /EHsc MathFuncsLib.cpp` to compile the code and create an object file that's named `MathFuncsLib.obj`. (The `cl` command invokes the compiler, Cl.exe, and the `/c` option specifies compile without linking. For more information, see [/c (Compile Without Linking)](../build/reference/c-compile-without-linking.md).) Second, run `lib MathFuncsLib.obj` to link the code and create the static library `MathFuncsLib.lib`. (The `lib` command invokes the Library Manager, Lib.exe. For more information, see [LIB Reference](../build/reference/lib-reference.md).)
@@ -76,44 +76,45 @@ An understanding of the fundamentals of the C++ language.
7676

7777
1. On the menu bar, choose **File** > **New** > **Project**.
7878

79-
2. In the left pane of the **New Project** dialog box, expand **Installed, Visual C++**, and then select **Windows Desktop**.
79+
1. In the left pane of the **New Project** dialog box, expand **Installed** > **Visual C++**, and then select **Windows Desktop**.
8080

81-
3. In the center pane, select **Windows Desktop Wizard**.
81+
1. In the center pane, select **Windows Desktop Wizard**.
8282

83-
4. 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-
5. Under **Application type**, select **Console Application (.exe)**.
83+
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.
8584

86-
6. Under **Additioal Options**, un-check the **Precompiled header** check box.
85+
1. Under **Application type**, select **Console Application (.exe)**.
8786

88-
7. Choose **OK** to create the project.
87+
1. Under **Additioal Options**, un-check the **Precompiled header** check box.
88+
89+
1. Choose **OK** to create the project.
8990

9091
## <a name="UseLibInApp"></a> Using the functionality from the static library in the app
9192

9293
### To use the functionality from the static library in the app
9394

9495
1. After you create a console app, an empty program is created for you. The name for the source file is the same as the name that you chose earlier. In this example, it's named `MyExecRefsLib.cpp`.
9596

96-
2. Before you can use the math routines in the static library, you must reference it. To do this, open the shortcut menu for the **MyExecRefsLib** project in **Solution Explorer**, and then choose **Add** > **Reference**.
97+
1. Before you can use the math routines in the static library, you must reference it. To do this, open the shortcut menu for the **MyExecRefsLib** project in **Solution Explorer**, and then choose **Add** > **Reference**.
9798

98-
3. The **Add Reference** dialog box lists the libraries that you can reference. The **Projects** tab lists the projects in the current solution and any libraries that they contain. On the **Projects** tab, select the **MathFuncsLib** check box, and then choose the **OK** button.
99+
1. The **Add Reference** dialog box lists the libraries that you can reference. The **Projects** tab lists the projects in the current solution and any libraries that they contain. On the **Projects** tab, select the **MathFuncsLib** check box, and then choose the **OK** button.
99100

100-
4. To reference the `MathFuncsLib.h` header file, you must modify the included directories path. In the **Property Pages** dialog box for **MyExecRefsLib**, expand the **Configuration Properties** node, expand the **C/C++** node, and then select **General**. Next to **Additional Include Directories**, specify the path of the **MathFuncsLib** directory or browse for it.
101+
1. To reference the `MathFuncsLib.h` header file, you must modify the included directories path. In the **Property Pages** dialog box for **MyExecRefsLib**, expand the **Configuration Properties** node, expand the **C/C++** node, and then select **General**. Next to **Additional Include Directories**, specify the path of the **MathFuncsLib** directory or browse for it.
101102

102103
To browse for the directory path, open the property value drop-down list, and then choose **Edit**. In the **Additional Include Directories** dialog box, in the text box, select a blank line and then choose the ellipsis button (**...**) at the end of the line. In the **Select Directory** dialog box, select the **MathFuncsLib** directory and then choose **Select Folder** button to save your selection and close the dialog box. In the **Additional Include Directories** dialog box, choose the **OK** button, and then in the **Property Pages** dialog box, choose the **OK** button to save your changes to the project.
103104

104-
5. You can now use the `MyMathFuncs` class in this app. To do this, replace the contents of `MyExecRefsLib.cpp` with this code:
105+
1. You can now use the `MyMathFuncs` class in this app. To do this, replace the contents of `MyExecRefsLib.cpp` with this code:
105106

106107
[!code-cpp[NVC_Walkthrough_Create_Static_Lib#120](../windows/codesnippet/CPP/walkthrough-creating-and-using-a-static-library-cpp_3.cpp)]
107108

108-
6. Build the executable by choosing **Build** > **Build Solution** on the menu bar.
109+
1. Build the executable by choosing **Build** > **Build Solution** on the menu bar.
109110

110111
## <a name="RunApp"></a> Running the app
111112

112113
### To run the app
113114

114115
1. Make sure that **MyExecRefsLib** is selected as the default project by opening the shortcut menu for **MyExecRefsLib** in **Solution Explorer**, and then choosing **Set as StartUp Project**.
115116

116-
2. To run the project, on the menu bar, choose **Debug** > **Start Without Debugging**. The output should resemble this:
117+
1. To run the project, on the menu bar, choose **Debug** > **Start Without Debugging**. The output should resemble this:
117118

118119
```Output
119120
a + b = 106.4
@@ -124,5 +125,5 @@ An understanding of the fundamentals of the C++ language.
124125
125126
## See Also
126127
127-
[Walkthrough: Creating and Using a Dynamic Link Library (C++)](../build/walkthrough-creating-and-using-a-dynamic-link-library-cpp.md)
128-
[Desktop Applications (Visual C++)](../windows/desktop-applications-visual-cpp.md)
128+
[Walkthrough: Creating and Using a Dynamic Link Library (C++)](../build/walkthrough-creating-and-using-a-dynamic-link-library-cpp.md)<br/>
129+
[Desktop Applications (Visual C++)](../windows/desktop-applications-visual-cpp.md)<br/>

docs/windows/walkthrough-creating-windows-desktop-applications-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Walkthrough: Create a traditional Windows Desktop application (C++) | Microsoft Docs"
33
ms.custom: "get-started-article"
4-
ms.date: "06/12/2018"
4+
ms.date: "09/18/2018"
55
ms.technology: ["cpp-windows"]
66
ms.topic: "conceptual"
77
dev_langs: ["C++"]

0 commit comments

Comments
 (0)