Skip to content

Commit 220ecd2

Browse files
authored
Mblome porting updates redux (MicrosoftDocs#140)
* updates for 2017 * added new file for 3rd party libs and updated toc * updates to tocs and to overview pages * updates in the porting section * additional updates to porting content * changed token to literal VS 2017 * changed token to literal VS2017 * changed token to literal VS2017 * changed token to literal VS 2015 (not 2017) * fixed link * fixed links * fixed link * fixed links * fixed token * fixed token * fixed another token
1 parent 86f6781 commit 220ecd2

16 files changed

Lines changed: 188 additions & 160 deletions

docs/TOC.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# [Visual C++ in Visual Studio 2017 RC](visual-cpp-in-visual-studio.md)
22
# [What's New for Visual C++ in Visual Studio 2017 RC](what-s-new-for-visual-cpp-in-visual-studio.md)
3+
# [C++ conformance improvements in Visual Studio 2017](cpp-conformance-improvements-2017.md)
34
# [Supported Platforms (Visual C++)](supported-platforms-visual-cpp.md)
45
# [C Language](c-language/c-language-reference.md)
56
# [C++ Language](cpp/cpp-language-reference.md)

docs/porting/how-to-use-existing-cpp-code-in-a-universal-windows-platform-app.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ translation.priority.ht:
3131
- "zh-tw"
3232
---
3333
# How to: Use Existing C++ Code in a Universal Windows Platform App
34-
This topic contains a discussion and procedures for porting C++ libraries (DLLs and static libraries) to the Universal Windows Platform (UWP), which is a necessary part of creating a Windows 10 UI layer that works with your existing classic Win32 C++ code or standard, cross-platform C++ code. There are several ways to use existing C++ code in a Universal Windows App.
34+
Perhaps the easiest way to get your desktop program running in the UWP environment is to use the Desktop Bridge technologies. These include the Desktop App Converter, which will package your existing application as a UWP app with no code changes required. For more information, see [Bring your desktop app to the Universal Windows Platform (UWP) with the Desktop Bridge](https://msdn.microsoft.com/windows/uwp/porting/desktop-to-uwp-root).
35+
36+
The rest of this topic discusses how to port C++ libraries (DLLs and static libraries) to the Universal Windows Platform (UWP). You might want to do this so that your core C++ logic can be used with multiple UWP apps.
3537

3638
UWP Apps run in a protected environment, and as a result, many Win32, COM, and CRT API calls that might compromise the security of the platform are not allowed. The compiler can detect such calls and generate an error, if the /ZW option is used. You can use the App Certification Kit on your application to detect code that calls forbidden APIs. See [Using the App Certification Kit](https://msdn.microsoft.com/library/windows/apps/hh694081.aspx).
3739

@@ -41,7 +43,7 @@ This topic contains a discussion and procedures for porting C++ libraries (DLLs
4143

4244
If you have source code for the DLL or static library, you can recompile with /ZW as a UWP project. If you do that, you can add a reference using the Solution Explorer, and use it in C++ UWP apps. In the case of a DLL, you link with the export library.
4345

44-
To expose functionality to callers in other languages, you can convert the library into a Windows Runtime Component. Windows Runtime Components differ from ordinary DLLs in that they include metadata in the form of .winmd files which describe the contents in a way that .NET and JavaScript consumers require. To expose API elements to other languages, you can add C++/CX constructs, such as ref classes, and make them public, or use the [Windows Runtime C++ Template Library (WRL)](../windows/windows-runtime-cpp-template-library-wrl.md).
46+
To expose functionality to callers in other languages, you can convert the library into a Windows Runtime Component. Windows Runtime Components differ from ordinary DLLs in that they include metadata in the form of .winmd files which describe the contents in a way that .NET and JavaScript consumers require. To expose API elements to other languages, you can add C++/CX constructs, such as ref classes, and make them public, or use the [Windows Runtime C++ Template Library (WRL)](../windows/windows-runtime-cpp-template-library-wrl.md). In Windows 10 and later, you can use the [C++/WinRT library](https://github.com/microsoft/cppwinrt) instead of C++/CX.
4547

4648
The preceding discussion doesn't apply to the case of COM components, which must be handled differently. If you have a COM server in an EXE or DLL, you can use it in a Universal Windows Project as long as you package it as a [registration-free COM component](https://msdn.microsoft.com/library/dd408052.aspx), add it to your project as a Content file, and instantiate it using [CoCreateInstanceFromApp](https://msdn.microsoft.com/library/windows/apps/hh404137.aspx). See [Using Free-COM DLL in Windows Store C++ Project](http://blogs.msdn.com/b/win8devsupport/archive/2013/05/20/using-free-com-dll-in-windows-store-c-project.aspx).
4749

@@ -91,23 +93,23 @@ This topic contains a discussion and procedures for porting C++ libraries (DLLs
9193
9294
class Giraffe
9395
{
94-
int id;
95-
Giraffe(int id_in);
96-
friend class GiraffeFactory;
96+
int id;
97+
Giraffe(int id_in);
98+
friend class GiraffeFactory;
9799
98100
public:
99-
GIRAFFE_API int GetID();
101+
GIRAFFE_API int GetID();
100102
};
101103
102104
class GiraffeFactory
103105
{
104-
static int nextID;
105-
106+
static int nextID;
107+
106108
public:
107-
GIRAFFE_API GiraffeFactory();
108-
GIRAFFE_API static int GetNextID();
109-
GIRAFFE_API static Giraffe* Create();
110-
};
109+
GIRAFFE_API GiraffeFactory();
110+
GIRAFFE_API static int GetNextID();
111+
GIRAFFE_API static Giraffe* Create();
112+
};
111113
```
112114
113115
And the following code file:
@@ -123,24 +125,24 @@ This topic contains a discussion and procedures for porting C++ libraries (DLLs
123125
124126
int Giraffe::GetID()
125127
{
126-
return id;
128+
return id;
127129
}
128130
129131
int GiraffeFactory::nextID = 0;
130132
131133
GiraffeFactory::GiraffeFactory()
132134
{
133-
nextID = 0;
135+
nextID = 0;
134136
}
135137
136138
int GiraffeFactory::GetNextID()
137139
{
138-
return nextID;
140+
return nextID;
139141
}
140142
141143
Giraffe* GiraffeFactory::Create()
142144
{
143-
return new Giraffe(nextID++);
145+
return new Giraffe(nextID++);
144146
}
145147
146148
int giraffeFunction();
@@ -195,10 +197,10 @@ This topic contains a discussion and procedures for porting C++ libraries (DLLs
195197
```
196198
MainPage::MainPage()
197199
{
198-
InitializeComponent();
199-
GiraffeFactory gf;
200-
Giraffe* g = gf.Create();
201-
int id = g->GetID();
200+
InitializeComponent();
201+
GiraffeFactory gf;
202+
Giraffe* g = gf.Create();
203+
int id = g->GetID();
202204
}
203205
204206
```
@@ -233,7 +235,7 @@ LNK4264: archiving object file compiled with /ZW into a static library; note tha
233235
234236
2. Close the project.
235237
236-
3. In the Windows File Explorer, locate the project. By default, Visual Studio uses the Visual Studio 2015\Projects folder in your Documents folder. Locate the C++ library project that contains the code you want to port. Copy the source files (header files, code files, and any other resources, including in subdirectories) from your C++ library project, and paste them into the project folder, making sure to preserve the same folder structure.
238+
3. In the Windows File Explorer, locate the project. By default, Visual Studio uses the Visual Studio 2017\Projects folder in your Documents folder. Locate the C++ library project that contains the code you want to port. Copy the source files (header files, code files, and any other resources, including in subdirectories) from your C++ library project, and paste them into the project folder, making sure to preserve the same folder structure.
237239
238240
4. Reopen the Windows Runtime Component project, and open the shortcut menu for the project node in **Solution Explorer**, and choose **Add, Existing Item**.
239241
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
translation.priority.ht:
3+
- "cs-cz"
4+
- "de-de"
5+
- "es-es"
6+
- "fr-fr"
7+
- "it-it"
8+
- "ja-jp"
9+
- "ko-kr"
10+
- "pl-pl"
11+
- "pt-br"
12+
- "ru-ru"
13+
- "tr-tr"
14+
- "zh-cn"
15+
- "zh-tw"
16+
---
17+
Visual C++ in Visual Studio 2017

docs/porting/modifying-winver-and-win32-winnt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Visual C++ no longer supports targeting Windows 95, Windows 98, Windows ME, Wind
6666
#define _WIN32_WINNT_WIN10 0x0A00 // Windows 10
6767
```
6868

69-
If you don't see all of these versions of Windows listed in a copy of SDKDDKVer.h that you're looking at, you probably are using an older version of the Windows SDK. By default, Win32 projects in [!INCLUDE[vs_dev14](../ide/includes/vs_dev14_md.md)] use the Windows 8.1 SDK. To use the Windows 10 SDK, see [How to: Use the Windows 10 SDK in a Windows Desktop Application](../windows/how-to-use-the-windows-10-sdk-in-a-windows-desktop-application.md).
69+
If you don't see all of these versions of Windows listed in a copy of SDKDDKVer.h that you're looking at, you probably are using an older version of the Windows SDK. By default, Win32 projects in Visual Studio 2017 use the Windows 10 SDK.
7070

7171
> [!NOTE]
7272
> Values are not guaranteed to work if you include internal MFC headers in your application.
@@ -76,4 +76,4 @@ Visual C++ no longer supports targeting Windows 95, Windows 98, Windows ME, Wind
7676
For more information about the meanings of these macros, see [Using the Windows Headers](http://msdn.microsoft.com/library/windows/desktop/aa383745).
7777

7878
## See Also
79-
[Previous Product Changes](http://msdn.microsoft.com/en-us/91fa1713-0778-4b6b-82f7-0fe0a23ab1db)
79+
[Previous Product Changes](http://msdn.microsoft.com/en-us/91fa1713-0778-4b6b-82f7-0fe0a23ab1db)

0 commit comments

Comments
 (0)