diff options
| author | Adonais Romero González <[email protected]> | 2024-05-06 16:21:31 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-06 16:21:31 -0700 |
| commit | a74a241c664c4e1d7c0838287b34076c19d9858a (patch) | |
| tree | 6ff7562612967b122acf8acf8a69c4dcfd5905db /general/WinHEC 2017 Lab/Toaster Support App/App/CustomCapability/cpp/pch.cpp | |
| parent | def8e8e34ed2b7b1deb2fc9112ac4255f1a0f2ba (diff) | |
| parent | 15477ce52bbb6b42ca591ecdfb484cac089f89ab (diff) | |
Merge develop changes prior to upcoming WDK release (May 2024)
Diffstat (limited to 'general/WinHEC 2017 Lab/Toaster Support App/App/CustomCapability/cpp/pch.cpp')
| -rw-r--r-- | general/WinHEC 2017 Lab/Toaster Support App/App/CustomCapability/cpp/pch.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/general/WinHEC 2017 Lab/Toaster Support App/App/CustomCapability/cpp/pch.cpp b/general/WinHEC 2017 Lab/Toaster Support App/App/CustomCapability/cpp/pch.cpp deleted file mode 100644 index b300c4c0..00000000 --- a/general/WinHEC 2017 Lab/Toaster Support App/App/CustomCapability/cpp/pch.cpp +++ /dev/null @@ -1,60 +0,0 @@ -//********************************************************* -// -// Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the MIT License (MIT). -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//********************************************************* - -// -// pch.cpp -// Include the standard header and generate the precompiled header. -// - -#include "pch.h" -#include "MainPage.xaml.h" - -#include <robuffer.h> -#include <wrl\client.h> - -using namespace Microsoft::WRL; -using namespace Windows::Storage::Streams; - -byte* GetArrayFromBuffer(Windows::Storage::Streams::IBuffer^ buffer) -{ - ComPtr<IInspectable> base = reinterpret_cast<IInspectable*>(buffer); - ComPtr<IBufferByteAccess> access; - - auto hr = base.As(&access); - - if (FAILED(hr)) - { - throw Platform::Exception::CreateException(hr); - } - - byte* data; - - hr = access->Buffer(&data); - - if (FAILED(hr)) - { - throw Platform::Exception::CreateException(hr); - } - - // The returned buffer is valid as long as the IBuffer passed in - // remains valid. - return data; -} - -void NotifyStatusMessage(Platform::String^ message, SDKTemplate::NotifyType messageType) -{ - SDKTemplate::MainPage::Current->Dispatcher->RunAsync( - Windows::UI::Core::CoreDispatcherPriority::Normal, - ref new Windows::UI::Core::DispatchedHandler( - [message, messageType]() { - SDKTemplate::MainPage::Current->NotifyUser(message, messageType); - })); -} |
