We are building a WinRT application with JavaScript (WinJS) that accesses REST/JSON web services via C# WinRT Component library. In the component library we have a Logon control (much like WebAuthenticationBroker) that allowes us to use ACS logon with our REST services.
Application Layers:
The problem: When trying to create the logon control, the WinRT throws "HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)" exception (when entering the UserControl's constructor) even if I call it via Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher (recommended in MSDN article I found about WinJS/C++ component).
If I call it from a Xaml/C# client, the code works with or without the Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher.RunAsync().
I've tried to google this and also read all the UserControl, Dispatcher and WinJS documentation but I have not found anything relevant. Is this a known problem and could someone suggest a workaround?
Since I'm a first time poster, please be gentle :-) Any help is extremely welcome!
Xaml-based WinRT controls cannot be used in Javascript-based WinRT projects. You can use any WinRT class library, but not Xaml controls inside them.
If you still want to combine HTML-Javascript with Xaml, I would recommend creating a Xaml-based project, and wrapping your HTML UI in a WebView control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With