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
* Master to live (MicrosoftDocs#446)
* Live (MicrosoftDocs#444)
* "unsigned long long" should be uint64_t, not int64_t
* Update use-native-multi-targeting.md
Add missing text to address issue #132.
* Fix typo in compiler-warnings-c4000-through-c4199.md
Remove extraneous `8`
* fix typo
* Confirm merge from FromPublicMasterBranch to master to sync with https://github.com/MicrosoftDocs/cpp-docs (branch master) (#445)
* "unsigned long long" should be uint64_t, not int64_t
* Update use-native-multi-targeting.md
Add missing text to address issue #132.
* Fix typo in compiler-warnings-c4000-through-c4199.md
Remove extraneous `8`
* fix typo
* Fix list formatting
Make actual numbered lists in markdown. Lint the markdown a little.
* Update wrl-integration-c-cx.md
Fix stray merge artifact per issue #137
* Fix typo of declaring
* Update cancellation-in-the-ppl.md
Fix formatting issue caused by a typo, as noted in issue #60 by @jjakubovic.
* Update ceil-ceilf-ceill.md
Add ntdll.dll location to apilocation metadata.
You freely can mix WRL code with [!INCLUDE[cppwrl](includes/cppwrl-md.md)] ([!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)]) code. In the same translation unit, you can use objects declared with WRL handle-to-object (`^`) notation and [!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)] smart pointer (`ComPtr<T>`) notation. However, you must manually handle return values, and [!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)] HRESULT error codes and WRL exceptions.
18
-
19
-
## [!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)] development
20
-
For more information about authoring and consuming [!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)] components, see [Windows Runtime C++ Template Library (WRL)](../windows/windows-runtime-cpp-template-library-wrl.md).
21
-
22
-
### Example
23
-
The following code snippet demonstrates using WRL and [!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)] to consume [!INCLUDE[wrt](includes/wrt-md.md)] classes and examine a metadata file.
24
-
>>>>>>> master
25
-
26
-
The example taken from a code snippet in the [Building Windows Store apps forum](http://social.msdn.microsoft.com/Forums/winappswithnativecode/thread/211ef583-db11-4e55-926b-6d9ab53dbdb4). The author of this code snippet offers the following disclaimers and stipulations:
27
-
28
-
1. C++ doesn't provide specific APIs to reflect on [!INCLUDE[wrt](includes/wrt-md.md)] types, but Windows metadata files (.winmd) for a type are fully compliant with CLR metadata files. Windows provides the new metadata discovery APIs (RoGetMetaDataFile) to get to the .winmd file for a given type. However, these APIs are of limited use to C++ developers because you can't instantiate a class.
29
-
30
-
2. After the code is compiled, you'll also need to pass Runtimeobject.lib and Rometadata.lib to the Linker.
31
-
32
-
3. This snippet is presented as-is. While it is expected to work correctly, it possibly can contain errors.
33
-
34
-
```
35
-
36
-
#include <hstring.h>
37
-
#include <cor.h>
38
-
#include <rometadata.h>
39
-
#include <rometadataresolution.h>
40
-
#include <collection.h>
41
-
42
-
namespace ABI_Isolation_Workaround {
43
-
#include <inspectable.h>
44
-
#include <WeakReference.h>
45
-
}
46
-
using namespace ABI_Isolation_Workaround;
47
-
#include <wrl/client.h>
48
-
49
-
using namespace Microsoft::WRL;
50
-
using namespace Windows::Foundation::Collections;
51
-
52
-
IVector<String^>^ GetTypeMethods(Object^);
53
-
54
-
MainPage::MainPage()
55
-
{
56
-
InitializeComponent();
57
-
58
-
Windows::Foundation::Uri^ uri = ref new Windows::Foundation::Uri("http://buildwindows.com/");
[Interoperating with Other Languages](interoperating-with-other-languages-c-cx.md)
17
+
18
+
You freely can mix WRL code with [!INCLUDE[cppwrl](includes/cppwrl-md.md)] ([!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)]) code. In the same translation unit, you can use objects declared with WRL handle-to-object (`^`) notation and [!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)] smart pointer (`ComPtr<T>`) notation. However, you must manually handle return values, and [!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)] HRESULT error codes and WRL exceptions.
19
+
20
+
## [!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)] development
21
+
22
+
For more information about authoring and consuming [!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)] components, see [Windows Runtime C++ Template Library (WRL)](../windows/windows-runtime-cpp-template-library-wrl.md).
23
+
24
+
### Example
25
+
26
+
The following code snippet demonstrates using WRL and [!INCLUDE[cppwrl_short](includes/cppwrl-short-md.md)] to consume [!INCLUDE[wrt](includes/wrt-md.md)] classes and examine a metadata file.
27
+
28
+
The example is taken from a code snippet in the [Building Windows Store apps forum](http://social.msdn.microsoft.com/Forums/winappswithnativecode/thread/211ef583-db11-4e55-926b-6d9ab53dbdb4). The author of this code snippet offers the following disclaimers and stipulations:
29
+
30
+
1. C++ doesn't provide specific APIs to reflect on [!INCLUDE[wrt](includes/wrt-md.md)] types, but Windows metadata files (.winmd) for a type are fully compliant with CLR metadata files. Windows provides the new metadata discovery APIs (RoGetMetaDataFile) to get to the .winmd file for a given type. However, these APIs are of limited use to C++ developers because you can't instantiate a class.
31
+
32
+
1. After the code is compiled, you'll also need to pass Runtimeobject.lib and Rometadata.lib to the Linker.
33
+
34
+
1. This snippet is presented as-is. While it is expected to work correctly, it possibly can contain errors.
35
+
36
+
```cpp
37
+
#include<hstring.h>
38
+
#include<cor.h>
39
+
#include<rometadata.h>
40
+
#include<rometadataresolution.h>
41
+
#include<collection.h>
42
+
43
+
namespaceABI_Isolation_Workaround {
44
+
#include <inspectable.h>
45
+
#include <WeakReference.h>
46
+
}
47
+
using namespace ABI_Isolation_Workaround;
48
+
#include <wrl/client.h>
49
+
50
+
using namespace Microsoft::WRL;
51
+
using namespace Windows::Foundation::Collections;
52
+
53
+
IVector<String^>^ GetTypeMethods(Object^);
54
+
55
+
MainPage::MainPage()
56
+
{
57
+
InitializeComponent();
58
+
59
+
Windows::Foundation::Uri^ uri = ref new Windows::Foundation::Uri("http://buildwindows.com/");
Copy file name to clipboardExpand all lines: docs/parallel/concrt/cancellation-in-the-ppl.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ This document explains the role of cancellation in the Parallel Patterns Library
75
75
For more examples that cancel parallel tasks, see [Walkthrough: Connecting Using Tasks and XML HTTP Requests](../../parallel/concrt/walkthrough-connecting-using-tasks-and-xml-http-requests.md), [How to: Use Cancellation to Break from a Parallel Loop](../../parallel/concrt/how-to-use-cancellation-to-break-from-a-parallel-loop.md), and [How to: Use Exception Handling to Break from a Parallel Loop](../../parallel/concrt/how-to-use-exception-handling-to-break-from-a-parallel-loop.md).
76
76
77
77
### <aname="tokens"></a> Using a Cancellation Token to Cancel Parallel Work
78
-
The `task`, `task_group`, and `structured_task_group` classes support cancellation through the use of cancellation tokens. The PPL defines the [concurrency::cancellation_token_source](../../parallel/concrt/reference/cancellation-token-source-class.md) and [concurrency::cancellation_token](../../parallel/concrt/reference/cancellation-token-class.md) classes for this purpose. When you use a cancellation token to cancel work, the runtime does not start new work that subscribes to that token. Work that is already active can use the [is_canceled]((../../parallel/concrt/reference/cancellation-token-class.md#is_canceled) member function to monitor the cancellation token and stop when it can.
78
+
The `task`, `task_group`, and `structured_task_group` classes support cancellation through the use of cancellation tokens. The PPL defines the [concurrency::cancellation_token_source](../../parallel/concrt/reference/cancellation-token-source-class.md) and [concurrency::cancellation_token](../../parallel/concrt/reference/cancellation-token-class.md) classes for this purpose. When you use a cancellation token to cancel work, the runtime does not start new work that subscribes to that token. Work that is already active can use the [is_canceled](../../parallel/concrt/reference/cancellation-token-class.md#is_canceled) member function to monitor the cancellation token and stop when it can.
79
79
80
80
81
81
To initiate cancellation, call the [concurrency::cancellation_token_source::cancel](reference/cancellation-token-source-class.md#cancel) method. You respond to cancellation in these ways:
0 commit comments