Skip to content

Commit 55efc4d

Browse files
openpublishbuildColin Robertson
authored andcommitted
Confirm merge from FromPublicMasterBranch to master to sync with https://github.com/MicrosoftDocs/cpp-docs (branch master) (#451)
* 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.
1 parent 88d5641 commit 55efc4d

File tree

4 files changed

+108
-106
lines changed

4 files changed

+108
-106
lines changed

docs/c-runtime-library/reference/ceil-ceilf-ceill.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.technology: ["cpp-standard-libraries"]
88
ms.tgt_pltfrm: ""
99
ms.topic: "article"
1010
apiname: ["ceilf", "ceil", "ceill"]
11-
apilocation: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-math-l1-1-0.dll"]
11+
apilocation: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "ntdll.dll", "api-ms-win-crt-math-l1-1-0.dll"]
1212
apitype: "DLLExport"
1313
f1_keywords: ["ceil", "ceilf", "ceill"]
1414
dev_langs: ["C++"]
@@ -73,4 +73,4 @@ long double ceill(
7373
[Floating-Point Support](../../c-runtime-library/floating-point-support.md)
7474
[floor, floorf, floorl](../../c-runtime-library/reference/floor-floorf-floorl.md)
7575
[fmod, fmodf](../../c-runtime-library/reference/fmod-fmodf.md)
76-
[round, roundf, roundl](../../c-runtime-library/reference/round-roundf-roundl.md)
76+
[round, roundf, roundl](../../c-runtime-library/reference/round-roundf-roundl.md)

docs/cpp/destructors-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ int main() {
6161

6262
In the preceding example, the destructor `String::~String` uses the `delete` operator to deallocate the space dynamically allocated for text storage.
6363

64-
## Delcaring destructors
64+
## Declaring destructors
6565
Destructors are functions with the same name as the class but preceded by a tilde (`~`)
6666

6767
Several rules govern the declaration of destructors. Destructors:

docs/cppcx/wrl-integration-c-cx.md

Lines changed: 104 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -14,105 +14,107 @@ ms.author: "ghogen"
1414
manager: "ghogen"
1515
---
1616
# WRL integration (C++/CX)
17-
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/");
59-
auto methods = GetTypeMethods(uri);
60-
61-
std::wstring strMethods;
62-
std::for_each(begin(methods), end(methods), [&strMethods](String^ methodName) {
63-
strMethods += methodName->Data();
64-
strMethods += L"\n";
65-
});
66-
67-
wprintf_s(L"%s\n", strMethods.c_str());
68-
}
69-
70-
IVector<String^>^ GetTypeMethods(Object^ instance)
71-
{
72-
HRESULT hr;
73-
HSTRING hStringClassName;
74-
hr = instance->__cli_GetRuntimeClassName(reinterpret_cast<__cli_HSTRING__**>(&hStringClassName)); // internal method name subject to change post BUILD
75-
if (FAILED(hr))
76-
__cli_WinRTThrowError(hr); // internal method name subject to change post BUILD
77-
String^ className = reinterpret_cast<String^>(hStringClassName);
78-
79-
ComPtr<IMetaDataDispenserEx> metadataDispenser; ComPtr<IMetaDataImport2> metadataImport; hr = MetaDataGetDispenser(CLSID_CorMetaDataDispenser, IID_IMetaDataDispenser, (LPVOID*)metadataDispenser.GetAddressOf());
80-
if (FAILED(hr))
81-
__cli_WinRTThrowError(hr); // internal method name subject to change post BUILD
82-
83-
HSTRING hStringFileName;
84-
mdTypeDef typeDefToken;
85-
hr = RoGetMetaDataFile(hStringClassName, metadataDispenser.Get(), &hStringFileName, &metadataImport, &typeDefToken);
86-
if (FAILED(hr))
87-
__cli_WinRTThrowError(hr); // internal method name subject to change post BUILD
88-
String^ fileName = reinterpret_cast<String^>(hStringFileName);
89-
90-
HCORENUM hCorEnum = 0;
91-
mdMethodDef methodDefs[2048];
92-
ULONG countMethodDefs = sizeof(methodDefs);
93-
hr = metadataImport->EnumMethods(&hCorEnum, typeDefToken, methodDefs, countMethodDefs, &countMethodDefs);
94-
if (FAILED(hr))
95-
__cli_WinRTThrowError(hr); // internal method name subject to change post BUILD
96-
97-
wchar_t methodName[1024];
98-
ULONG countMethodName;
99-
std::wstring strMethods;
100-
Vector<String^>^ retVal = ref new Vector<String^>();
101-
102-
for(int i = 0; i < countMethodDefs; ++i)
103-
{
104-
countMethodName = sizeof(methodName);
105-
hr = metadataImport->GetMethodProps(methodDefs[i], nullptr, methodName, countMethodName, &countMethodName, nullptr, nullptr, nullptr, nullptr, nullptr);
106-
if (SUCCEEDED(hr))
107-
{
108-
methodName[ countMethodName ] = 0;
109-
retVal->Append(ref new String(methodName));
110-
}
111-
}
112-
return retVal;
113-
}
114-
115-
```
116-
117-
## See Also
118-
[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+
namespace ABI_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/");
60+
auto methods = GetTypeMethods(uri);
61+
62+
std::wstring strMethods;
63+
std::for_each(begin(methods), end(methods), [&strMethods](String^ methodName) {
64+
strMethods += methodName->Data();
65+
strMethods += L"\n";
66+
});
67+
68+
wprintf_s(L"%s\n", strMethods.c_str());
69+
}
70+
71+
IVector<String^>^ GetTypeMethods(Object^ instance)
72+
{
73+
HRESULT hr;
74+
HSTRING hStringClassName;
75+
hr = instance->__cli_GetRuntimeClassName(reinterpret_cast<__cli_HSTRING__**>(&hStringClassName)); // internal method name subject to change post BUILD
76+
if (FAILED(hr))
77+
__cli_WinRTThrowError(hr); // internal method name subject to change post BUILD
78+
String^ className = reinterpret_cast<String^>(hStringClassName);
79+
80+
ComPtr<IMetaDataDispenserEx> metadataDispenser; ComPtr<IMetaDataImport2> metadataImport; hr = MetaDataGetDispenser(CLSID_CorMetaDataDispenser, IID_IMetaDataDispenser, (LPVOID*)metadataDispenser.GetAddressOf());
81+
if (FAILED(hr))
82+
__cli_WinRTThrowError(hr); // internal method name subject to change post BUILD
83+
84+
HSTRING hStringFileName;
85+
mdTypeDef typeDefToken;
86+
hr = RoGetMetaDataFile(hStringClassName, metadataDispenser.Get(), &hStringFileName, &metadataImport, &typeDefToken);
87+
if (FAILED(hr))
88+
__cli_WinRTThrowError(hr); // internal method name subject to change post BUILD
89+
String^ fileName = reinterpret_cast<String^>(hStringFileName);
90+
91+
HCORENUM hCorEnum = 0;
92+
mdMethodDef methodDefs[2048];
93+
ULONG countMethodDefs = sizeof(methodDefs);
94+
hr = metadataImport->EnumMethods(&hCorEnum, typeDefToken, methodDefs, countMethodDefs, &countMethodDefs);
95+
if (FAILED(hr))
96+
__cli_WinRTThrowError(hr); // internal method name subject to change post BUILD
97+
98+
wchar_t methodName[1024];
99+
ULONG countMethodName;
100+
std::wstring strMethods;
101+
Vector<String^>^ retVal = ref new Vector<String^>();
102+
103+
for (int i = 0; i < countMethodDefs; ++i)
104+
{
105+
countMethodName = sizeof(methodName);
106+
hr = metadataImport->GetMethodProps(methodDefs[i], nullptr, methodName, countMethodName, &countMethodName, nullptr, nullptr, nullptr, nullptr, nullptr);
107+
if (SUCCEEDED(hr))
108+
{
109+
methodName[ countMethodName ] = 0;
110+
retVal->Append(ref new String(methodName));
111+
}
112+
}
113+
return retVal;
114+
}
115+
116+
```
117+
118+
## See also
119+
120+
[Interoperating with Other Languages](interoperating-with-other-languages-c-cx.md)

docs/parallel/concrt/cancellation-in-the-ppl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ This document explains the role of cancellation in the Parallel Patterns Library
7575
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).
7676

7777
### <a name="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.
7979

8080

8181
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

Comments
 (0)