c++-cx

Why can properties not be public inside a ref class sealed

醉酒当歌 提交于 2019-12-07 18:59:39
问题 The following code is illegal ( Visual Studio 2012 Windows Phone( Creating a windows phone direct3d app ) ) a non-value type cannot have any public data members 'posX' Header ref class Placement sealed { public: Placement( float rotX, float rotY, float rotZ, float posX, float posY, float posZ ); float rotX, rotY, rotZ, posX, posY, posZ; }; Cpp Placement::Placement( float rotX, float rotY, float rotZ, float posX, float posY, float posZ ) : posX( posX ), posY( posY ), posZ( posZ ) { this->rotX

Why can I not blocking main thread in WinRT(Windows Store App)?

老子叫甜甜 提交于 2019-12-06 09:53:25
问题 This question is not about "should I block my main thread" as it is generally a bad idea to block a main/STA/UI thread-for messaging and UI operations, but why WinRT C++/cx doesn't allow any blocking of the main thread compared to iOS, Android, and even C#(await doesn't actually block though). Is there a fundamental difference in the way Android or iOS block the main thread? Why is WinRT the only platform that doesn't allow any form of blocking synchronization? EDIT: I'm aware of co-await in

AdMob Interstitial Cocos2d-x WP8

痞子三分冷 提交于 2019-12-06 08:22:41
问题 Can enyone tell me how to call AdMob Interstitial between scenes in my cocos2d-x game? I have tried this http://robwirving.com/2014/07/21/calling-c-methods-c-winrt-components/ guide, but i don't know how to run it from cocos classes. Is there any another ways, or some guides? 回答1: I've recently made it. You have to do few things. First of all create helper class, which will help you calling native function (I use this for all 3 platforms, but here's just windows phone): NativeHelper.h:

How does one make function calls or trigger events from a Native component into a C#/XAML component?

会有一股神秘感。 提交于 2019-12-06 08:09:08
I am developing a WP8 application with a Native (DirectX/D3D) component and a C#/XAML component. The Native component draws to a UI element and the C#/XAML component has the controls of the app (and other things) surrounding it. Usually, I send information from the C#/XAML component down to the Native component. But there are certain times when I would like to trigger events in the C#/XAML component based on when processing is done in the Native component. In one planned feature, I envision a C#/XAML progress bar that is kept up to date by events triggered in the Native component.

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

本秂侑毒 提交于 2019-12-06 04:37:33
问题 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. 回答1: 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

WinRT Reflection (C++/CX)

拜拜、爱过 提交于 2019-12-06 04:36:40
问题 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). 回答1: C++ doesn't provide any specific APIs to reflect on WinRT types, these types are

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

社会主义新天地 提交于 2019-12-05 18:40:46
问题 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 :)

How do I parse a date in a Metro (C++/CX) app?

五迷三道 提交于 2019-12-05 11:46:00
问题 I have a C++/CX app that is processing some data from a file. It has a string in there representing the culture that was used to save the dates, and it has some dates. I need to convert them from strings to Platform::DateTime. I have heard that Windows::Globalization::DateTimeFormatting is the class to use, but I don't see how to use it for that. Does anyone have an example? 回答1: The C++/CX projection of WinRT differs from the Managed (C#/VB) projection in a number of ways, and one of the

Windows Phone 8(WP8) C# unsafe code?

我是研究僧i 提交于 2019-12-05 01:05:52
问题 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

Compiling C++/CX on the command line

妖精的绣舞 提交于 2019-12-04 17:06:50
I get the linker error fatal error C1107: could not find assembly 'platform.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environment variable when I try to compile a C++/CX program on the command line. The error is the same after I followed the instructions on this page: https://msdn.microsoft.com/en-us/library/dn769142.aspx (to summarize: run cl /ZW /EHsc source.cpp from the Developer Command Prompt for VS2015 ) I also tried running vcvarsall.bat x86 store from the Developer Command Prompt for VS2015 but I still get the same error (the same error also