Windows Phone 8: access UI Dispatcher in C++ code
Asked Answered
M

1

2

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()).

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();

However this is returning null. Is there any way for me to accomplish this?

Moya answered 21/6, 2013 at 21:50 Comment(0)
G
0

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
Goldengoldenberg answered 3/1, 2014 at 12:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.