c++-cx

UWP/WinRT: How to save and then restore a simple TextBox for resume from termination?

痞子三分冷 提交于 2019-12-22 09:47:52
问题 In this document describing the lifecycle of a Windows 10 UWP app, it states: Users now expect your app to remember its state as they multitask on their device. For example, they expect the page to be scrolled to the same position and all of the controls to be in the same state as before. By understanding the application lifecycle of launching, suspending, and resuming, you can provide this kind of seamless behavior. However, there doesn't appear to be much documentation on how this is

What is _In_ in C++?

≡放荡痞女 提交于 2019-12-18 12:09:19
问题 I have searched this up rather a lot, but come up with no helpful results. I am currently trying to program simple DirextX game for Windows 8 Metro, and have come across _In_ rather a lot. I'm just wondering what it is. Also, I have seen a lot of the use of ^ as the pointer * which I found odd. On top of this, some classes have an interface of ref class MyClass , which I believe is for C# legibility. Anyway, any help would be brilliant. 回答1: It is a SAL annotation, used for code analysis. The

WinRT C++ (Win10), opencv HSV color space, image display, artifacts

ⅰ亾dé卋堺 提交于 2019-12-13 06:47:24
问题 My goal is to make an object tracking. I have a UWP c# app and linked c++ windows runtime component. There I can obtain acces to opencv. In c#, MediaCapture return SoftwareBitmap. Then I pass SoftwareBitmap to c++ and convert it to opencv's Mat. Then cvtColor(cvFrame, cvFrame, COLOR_BGR2HSV); And then convert back to SoftwareBitmap, with BitmapPixelFormat::Bgra8 ( only Bgra8 is accepted by Software Bitmap ) and BitmapAlphaMode::Ignore And there is what I've got screen If I skip a cvtColor

Windows 8 Store App DirectX 11.1 Enabling Blendstate with loaded PNG texture with alpha

跟風遠走 提交于 2019-12-13 06:17:40
问题 I am loading a PNG with transparency to a texture with the following code: ComPtr<IWICStream> stream; ComPtr<IWICBitmapDecoder> bitmapDecoder; ComPtr<IWICBitmapFrameDecode> bitmapFrame; ComPtr<IWICFormatConverter> formatConverter; unsigned int width, height D3D11_SUBRESOURCE_DATA resourceData; ZeroMemory(&resourceData, sizeof(resourceData)); DX::ThrowIfFailed( m_wicFactory->CreateStream(&stream) ); DX::ThrowIfFailed( stream->InitializeFromMemory( rawFileBytes->Data, rawFileBytes->Length) );

Creating a UWP DLL using Windows::Media::SpeechSynthesis

天大地大妈咪最大 提交于 2019-12-13 03:33:37
问题 I am currently trying to develop a speech synthesis UWP DLL using the namespace Windows::Media::SpeechSynthesis. I read this documentation and the Microsoft page dedicated to the namespace. I tried to implement the namespace in code. Header file #pragma once #include <stdio.h> #include <string> #include <iostream> #include <ppltasks.h> using namespace Windows::Media::SpeechSynthesis; using namespace Windows::UI::Xaml::Controls; using namespace Windows::UI::Xaml::Media; using namespace Windows

WIndows-10 Mobile: “The specified module could not be found. (Exception from HRESULT: 0x8007007E)”:null

安稳与你 提交于 2019-12-13 02:35:24
问题 I have a C# app targeting UWP/Windows-10 for desktop & mobile platforms. The C# app calls into native component written in C++. My native C++ code has Visual C++ component extensions(C++/CX). The native code is then packaged as a .dll & bundled along with the app. The app works perfectly fine on Desktop, i.e when I run it in x86 or x64 , Local Machine , but encounters this error while running on Mobile, i.e. on x86 Mobile Emulator or on an ARM device(Nokia 950) The specified module could not

Using a vector of structs in a struct in c++/cx

一笑奈何 提交于 2019-12-13 02:13:06
问题 I have a header file defining some structs I want to use in my code. public value struct HttpHeader { Platform::String^ mName; Platform::String^ mValue; }; typedef Platform::Collections::Vector<HttpHeader> HttpHeaders; public value struct HttpRequestEvent { Platform::String^ mUri; HttpHeaders^ mHeaders; }; When I build this I get this error: error C3986: 'mHeaders': signature of public member contains native type 'std::equal_to<_Ty>' with [ _Ty=cpcpb::HttpHeader ] (SettingsServiceImpl.cpp)

Including windows.storage.streams.h

你。 提交于 2019-12-13 00:08:48
问题 I'm trying to put class NativeBuffer from this answer but when windows.storage.streams.h I have much errors like: Error 1 error C2872: 'AsyncStatus' : ambiguous symbol c:\program files (x86)\windows phone kits\8.0\include\abi\asyncinfo.h 75 Error 2 error C2872: 'AsyncStatus' : ambiguous symbol c:\program files (x86)\windows phone kits\8.0\include\abi\asyncinfo.h 76 Error 3 error C2872: 'AsyncStatus' : ambiguous symbol c:\program files (x86)\windows phone kits\8.0\include\abi\asyncinfo.h 77

How can I see what references are keeping my ref objects from being deleted in c++/cx?

时光总嘲笑我的痴心妄想 提交于 2019-12-12 22:25:21
问题 I use myclass^ in one place in my UWP project, but I suspected that they weren't actually being deleted when they went out of scope. So I made a destructor that called __debugbreak() for myclass^ to make sure that was getting called. Instead of the 40 calls I should be getting for my project, I got one. To my understanding, types with hats (^) are basically shared_ptrs so if my object isn't getting deleted, it's probably because something else in the project holds a reference to it. How can I

Parse JSON ISO8601 date in C++/CX

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 16:36:04
问题 I have a date string coming from JSON "2012-08-01T15:42:06Z" and want to parse that in Windows Runtime. As far as I know, only COleDateTime is available to handle this. I can only get it to correctly parse the string when I take out the 'T' & 'Z' characters, but that adds an extra parsing step on my end. WORKS: COleDateTime dateTime; dateTime.ParseDateTime(L"2012-08-01 15:42:06", 0UL, 1033UL); FAILS: COleDateTime dateTime; dateTime.ParseDateTime(L"2012-08-01T15:42:06Z", 0UL, 1033UL); Anyone