Replies: 3 comments
-
MS can call it in constructors in their samples, like : MainWindow.xaml.cpp#L22 or global class variables : |
Beta Was this translation helpful? Give feedback.
-
On the ABI level, it would be a series of calls including RoGetActivationFactory to get the IDispatcherQueueStatics interface, followed by IDispatcherQueueStatics::GetForCurrentThread. |
Beta Was this translation helpful? Give feedback.
-
Thank you both for the responses. |
Beta Was this translation helpful? Give feedback.
-
Is it okay to call
winrt::Microsoft::UI::Dispatching::DispatcherQueue::GetForCurrentThread()
on an as-needed basis?Or is it better to store the returned
DispatcherQueue
in a variable? In other words, doesGetForCurrentThread()
already do some caching?I've looked at the source code, but like a lot of C++/WinRT, I can't really tell what it's doing:
Thanks for any info.
Beta Was this translation helpful? Give feedback.
All reactions