的Windows Phone 8:访问UI调度中的C ++代码 [英] Windows Phone 8: access UI Dispatcher in C++ code
问题描述
我的工作,使用混合C#的UI和C ++为底层的支持的Windows Phone 8应用。我有一些情况下,我需要运行UI调度线程(IE GetGeopositionAsync())上的一些C ++代码。
I am working on an Windows Phone 8 Application that uses mixed C# for UI and C++ for the underlying backed. I have some instances where I need to run some C++ code on the UI dispatcher thread (IE GetGeopositionAsync()).
我试图从C作出回调的方法++到在UI线程中运行,然后调用C ++方法和运行C#:
I have tried a method of making a callback from C++ to C# that runs in the UI thread and then calls a C++ method and runs:
auto window = Windows::UI::Core::CoreWindow::GetForCurrentThread();
然而,这是返回null。有没有办法为我做到这一点?
However this is returning null. Is there any way for me to accomplish this?
推荐答案
我有一个类似的问题前几天,因为它总是返回null 。我结束了使用WinRT的。根据MSDN( 1 ,的 2 ),你应该能够在使用该WP8也是如此。
I had a similiar problem some days ago, as it has always returned null. I ended up using in WinRT. According to MSDN (1, 2) you should be able to use this in WP8 as well.
CoreApplication.MainView.CoreWindow
这篇关于的Windows Phone 8:访问UI调度中的C ++代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!