c++-cx

WinRT Reflection (C++/CX)

梦想的初衷 提交于 2019-12-04 11:07:44
how can I introspect an object in C++/CX? I known how to get its class name (using IInspectable) but I wasn't able to figure out how to get a list of its properties or how to invoke methods if I have just a name of the method (string). I searched for an answer here and at Google but what I found is related to the .NET layer of WinRT (the System.Reflection namespace doesn't seem to be available in C++/CX). C++ doesn't provide any specific APIs to reflect on WinRT types, these types are fully defined in CX compliant metadata files and you can use the CLR native metadata APIs to read their

How to get access to WriteableBitmap.PixelBuffer pixels with C++?

安稳与你 提交于 2019-12-04 09:41:22
There are a lot of samples for C#, but only some code snippets for C++ on MSDN. I have put it together and I think it will work, but I am not sure if I am releasing all the COM references I have to. Your code is correct--the reference count on the IBufferByteAccess interface of *buffer is incremented by the call to QueryInterface , and you must call Release once to release that reference. However, if you use ComPtr<T> , this becomes much simpler--with ComPtr<T> , you cannot call any of the three members of IUnknown ( AddRef , Release , and QueryInterface ); it prevents you from calling them.

Why my C++/CX unit-test does not fail?

一笑奈何 提交于 2019-12-04 06:08:50
问题 I have the following "Windows Store/Metro Style" test methods in VS 2012 C++/CX This one succeeds, which is ok TEST_METHOD(TestMethod) { bool passed = false; concurrency::event finished; finished.reset(); auto testTask = concurrency::create_task( [&finished, &passed]() { passed = true; finished.set(); }); finished.wait(100000); Assert::IsTrue(passed); } This one fails, which is also ok: TEST_METHOD(TestMethod) { bool passed = true; concurrency::event finished; finished.reset(); auto testTask

Windows 8 MessageWebSocket http request garbage

给你一囗甜甜゛ 提交于 2019-12-04 06:05:14
问题 I'm developing a Windows 8 app that communicates with a node.js server using node.js/socket.io, and have ran into a pile of issues with connecting. I decided to run a tcp sniffer application (microsoft network monitor 3.4), and noticed that before sending the http request, there is a bunch of garbage in my string: C8 D7 19 87 09 1C C8 60 00 13 8C FA 08 00 45 00 00 C3 37 78 40 00 80 06 00 00 C0 A8 01 71 17 17 5C 67 C2 4F 01 BB 06 1A 36 71 A2 8B 48 C7 50 18 04 00 36 4D 00 00 47 45 54 20 2F 20

Changing namespace name of C++ component in Windows Phone causes exception

别等时光非礼了梦想. 提交于 2019-12-04 04:13:40
问题 I have a C++ runtime component in a WP8 application, and if I change the namespace name, I get a "TargetInvocation" exception thrown whenever I try to instantiate a class in that namespace. As an example, if I create the default C++ Windows Runtime Component, the header looks like this: #pragma once namespace CppComponent1 { public ref class WindowsPhoneRuntimeComponent sealed { public: WindowsPhoneRuntimeComponent(); }; } If I change CppComponent1 to CppComponent2 in the .h and the .cpp, and

Will Windows 8 Metro support managed c++/cli

青春壹個敷衍的年華 提交于 2019-12-04 03:36:39
问题 I can't seem to find an answer to this question anywhere, but will metro support managed c++ ?? Right now in Visual Studios 2012 RC it does not (in Metro only). I have some frameworks written in c++/cli and wanted to port them to Metro. I know c++/cx is similar, but my c++/cli objects derive from ones written in C# and it would suck to have to rewrite that part of my system (but ok if I do, I just need to know where to go from here). If there are plans to support it when Windows 8 actually

FreeType “generic” conflict with c++/cx keyword

邮差的信 提交于 2019-12-04 02:37:55
I have a problem with putting c++ and c++/cx together. I need to use FreeType library, but they are using "generic" name for some variable. I also need to enable VC++ extensions because WinRT app, which causes name conflict (generic is keyword in c++/cx) 1>freetype2\include\freetype\freetype.h(1391): error C2059: syntax error : 'generic' I only added freetype reference and aditional include directories to my project properties. Is there some way to solve this case? Thank you for your help :) Tomas Use preprocessor to rename this keyword temporarily: #define generic GenericFromFreeTypeLibrary

How to get the array of struct with “byte array” from WinRT C++ to C# in Windows Store app?

六月ゝ 毕业季﹏ 提交于 2019-12-04 01:24:19
问题 Here I have a C# metro app with a C++ WinRT component. I need to do something in WinRT, like assign a photo's name/path, and retrieve photo's thumbnail. First, I write a value struct and retrieve struct array function in WinRT C++ as below. public value struct Item { String^ strName; String^ strPath; }; public ref class CTestWinRT sealed { public: CTestWinRT(); void TestOutStructArray(Platform::WriteOnlyArray<Item>^ intOutArray) { intOutArray->Data[0].strName = ref new String(L"test1.jpg");

Windows Phone 8(WP8) C# unsafe code?

▼魔方 西西 提交于 2019-12-03 16:45:11
EDIT: You can use unsafe code... you just have to manually edit the proj file. Why or why does C# on WP8 not support unsafe code when I can use native C++ code on the phone(I did not expect this)? I mean rly come on, I am so disappointed with what Microsoft is trying to force C# into. Is there any MS plans to support this in the future on WP8? I pass shader constants from C# to C++ and use unsafe code to optimize this process but on WP8 i'm going to be forced into doing this in some slow fashion on a WAY slower device compared to a PCs and it makes this very frustrating. As an example to pass

Converting a SoftwareBitmap or WriteableBitmap to cv::Mat in c++/cx

…衆ロ難τιáo~ 提交于 2019-12-02 17:50:41
问题 I tried to convert a WriteableBitmap to a cv::Mat in a c++/cx Microsoft universial App. But when I try to progress with the created Mat, I get the following error: This is my Code: void App1::MainPage::processImage(SoftwareBitmap^ bitmap) { WriteableBitmap^ wb = ref new WriteableBitmap(bitmap->PixelWidth, bitmap->PixelHeight); bitmap->CopyToBuffer(wb->PixelBuffer); Mat img_image(wb->PixelHeight, wb->PixelWidth, CV_8UC3,(void*)wb->PixelBuffer); //next step results in error cvtColor(img_image,