Russian two way cams chat - Updating ui from thread c

D3DComponent Dispatcher:: Dequeue UIDispatch Activity() { // This method is called from the C# dispatcher on the UI Thread!By default, each time your application executes a piece of code, this code is run on the same thread as the application itself.

updating ui from thread c-44updating ui from thread c-86

What if you are developing a Direct3D/C++ Windows Phone App and you need to get to the UI from another thread?

If you are using the Windows Phone Direct3D App, then getting to the UI thread is just as easy as it would be in Managed code land, the names are just a bit different.

So we need to get a bit creative if we want to get to the UI thread from the C++, here is the solution I’ve used.

First implement a new C++ class with a pure virtual Do Activity() function: public delegate void Dequeue UIDispatch Activity(); public ref class D3DComponent Dispatcher sealed { public: void Set Dequeue Delegate(Dequeue UIDispatch Activity^ delegate) { m_delegate = delegate; }; void Dequeue UIDispatch Activity(); internal: void Enqueue UIDispatch Activity(UIDispatch Activity* p Activity); private: queue as easy as writing a lambda.

This means that while this code is running, nothing else happens inside of your application, including the updating of your UI.

Comments