Windows error 0x8001010E, -2147417842

Detailed Error Information

RPC_E_WRONG_THREAD[1]

MessageThe application called an interface that was marshalled for a different thread.
Declared inwinerror.h

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode1 (0x001)
NameFACILITY_RPC[2][1]
DescriptionThe source of the error code is an RPC subsystem.[2][1]
Error Code270 (0x010e)

Questions

55votes
3answers

The application called an interface that was marshalled for a different thread - Windows Store App

So, first I have read a ton of threads on this particular problem and I still do not understand how to fix it. Basically, I am trying to communicate with a websocket and store the message received in an observable collection that is bound to a listview. I know that [...] read more
c#
multithreading
xaml
windows-store-apps
17votes
3answers

Update UI from thread in WinRT

Since the Windows 8 consumer preview was released a few days ago, I am working on the new WinRT (for Metro Applications) in C# and I had ported my self written IRC class to the new threading and networking. The problem is: My class is running an thread for receiving [...] read more
c#
windows-runtime
6votes
3answers

C# UWP The application called an interface that was marshalled for a different thread

I have a C# UWP app that contains a function I want to call every 5 seconds. The function runs fine when called from a button, and the Timer write to the debug console fine every 5 seconds....When I call the function from the Timer, all heck breaks loose. I [...] read more
c#
multithreading
uwp
6votes
1answer

Windows 8 App The application called an interface that was marshalled for a different thread

I am working on a Windows 8 application using c#/XAML. Everything has been working except for this event handler where I get the following error on this line. await RefreshUserInfoAsync(); The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)) This Observable Collection [...] read more
winrt-xaml
5votes
1answer

Get Heart Rate From Microsoft Band

I am trying to get the heart rate from a Microsoft Band. It should be updating whenever the value changes. I am then trying to display that value in a TextBlock. I first create an instance of IBandClient, and set its HeartRate.ReadingChanged method like this: bandClient.SensorManager.HeartRate.ReadingChanged += HeartRate_ReadingChanged; Then I [...] read more
c#
windows-phone-8.1
microsoft-band
4votes
1answer

Using UWP controls in WPF

I need to use InkCanvas (which is part of UWP Windows.UI.Xaml.Controls) in a WPF application. I know the WPF has InkCanvas too but they are totally different. The UWP InkCanvas has also InkAnalyzer which I need for handwriting recognition. I created a fresh WPF app and added references bellow: * [...] read more
wpf
xaml
uwp
inkcanvas
4votes
3answers

Instantiate WriteableImage in Background Task

I am writing a Windows 8 Store App with Live Tiles. Every live tile is an image that needs to be refreshed every x minutes. I am using a Background Task with a time trigger to generate my image and refresh the tile. Generating my image implies creating a new [...] read more
windows-8
windows-runtime
4votes
0answers

Unable to cast COM object of type 'System.__ComObject' to interface type

I am really pulling my hair out at this one. I have literally no idea why I am having these issues. Right, I have 3 SSIS packages. One for development, one for user acceptance testing and one for a live release. Each package is pretty much an exact copy of [...] read more
ssis
mariadb
3votes
4answers

Unable to cast COM object of type 'System._COMObject' to interface type

I have 3 SSIS packages. Two out of the 3 SSIS packages work perfectly, the third. Which is a copy of the 2nd one, except changing connection strings keeps throwing the problem: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSObject100'. This operation failed because the QueryInterface [...] read more
ssis
3votes
0answers

Creating instance of BitmapImage throws exception (RPC_E_WRONG_THREAD)

I'm trying to create an instance of BitmapImage in a method called IsImageValid. When doing so, I get this exception: > the application called an interface that was marshalled for a different > thread. (exception from hresult: 0x8001010e (rpc_e_wrong_thread)) This is my code: public bool isImageValid(string imagePath) { try { [...] read more
c#
multithreading
bitmapimage
2votes
1answer

UWP SolidColorBrush - The application called an interface that was marshalled for a different thread exception

I have a UWP application that receives a dynamic updates via SignalR. I'm using Template10 and the SignalR listener is located in the ViewModel class. When messages are received by SignalR - the Model is updated. The block of code that updates the model is wrapped in Despatcher method: VM [...] read more
c#
multithreading
xaml
uwp
2votes
1answer

Writeable bitmap constructor crash

I'm trying to do some ocr with windows phone 8.1 using this: https://blogs.windows.com/buildingapps/2014/09/18/microsoft-ocr-library-for-windows-runtime/ private async void camera_PhotoConfirmationCaptured(MediaCapture sender, PhotoConfirmationCapturedEventArgs e) { try { WriteableBitmap bitmap = new WriteableBitmap((int)e.Frame.Width, (int)e.Frame.Height); //crash here await bitmap.SetSourceAsync(e.Frame); OcrResult result = await ocr.RecognizeAsync(e.Frame.Height, e.Frame.Width, bitmap.PixelBuffer.ToArray()); foreach (var line in result.Lines) { } } catch(Exception ex) [...] read more
c#
windows-phone-8.1
ocr
2votes
0answers

C# UWP: How to wire Prism to Secondary Window due to Threading?

So, basically, one of my feature ideas would need a secondary window (if you open Windows Mail and then click on "Open in a new Window, you can see what I mean). For that you have two choices: ProjectionView (which is intended for non-interactive displays) and a completely new View. [...] read more
c#
multithreading
uwp
prism
2votes
2answers

The application called an interface that was marshalled for a different thread - Xamarin Forms

I am loading some data via WCF on the loading of a given page. I then want to populate a Picker with the values once the data has loaded. However, I'm getting a cross threading problem. Here is the code: protected async override void OnAppearing() { base.OnAppearing(); await Task.Factory.StartNew(async () [...] read more
c#
multithreading
wcf
xamarin
xamarin.forms
2votes
1answer

NEW TITLE -- The application called an interface that was marshalled for a different thread

After making the project simpler, I believe I identified the problem is actually a result the async marshalling. UPDATE: I made the code simpler to try to figure out what was going on. So here is an update... The Observable collection is being populated on a new thread (async method). [...] read more
c#
listview
data-binding
xamarin.forms
2votes
1answer

Windows 10 IoT Core - video open close

I've been working project in Raspberry Pi 2 running Windows 10 IoT Core. Project subject sensor triggering with open a video. But I am getting the following error: > An exception of type 'System.Exception' occurred in ProjeVol1.exe but was not > handled in user code > > Additional information: The [...] read more
c#
windows
raspberry-pi2
windows-iot-core-10
2votes
2answers

Why Does Raising PropertyChanged events from a timer cause an COMException?

I'm developing a Universal Windows Platform app using XAML that runs on a Raspberry Pi under Windows 10 IoT Core. The app drives a temperature sensor that's on the I2C bus. The sensor class is MLX90614Thermometer. The sensor uses a DispatcherTimer to take readings every 100 milliseconds (approx) and updates [...] read more
xaml
uwp
inotifypropertychanged
windows-10-iot-core
mvvm-toolkit
2votes
0answers

Qt Debugging using Visual Studio Kits

I have a problem with the CDB debugger. In particular if I try to use the predefined kit MinGW, all the debugging functionalities work correctly, whereas if I try to use the Visual Studio Kit, Qt Creator generates some issue. Note that I'm using the Visual Studio Express 2012 version [...] read more
c++
qt
debugging
visual-studio-2012
2votes
1answer

DispatcherTimer in background task of windows phone 8.1

I want to create a background task in windows phone 8.1 and I want to use a timer task in order to count down a specific time. Therefore, I try using DispatcherTimer class to do this. However, it shows up an error when I try to create it: DispatcherTimer timer [...] read more
c#
windows-phone-8.1
2votes
1answer

The Band application called an interface that was marshalled for a different thread

I am creating a Windows 8.1 Phone App. The UI has a button and a TextBox (called txtStatus) Basically, when I click a button in the UI, the following code kicks off (only some of it is shown): private async void btnStart_Click(object sender, RoutedEventArgs e) { try { // Get [...] read more
c#
async-await
microsoft-band
2votes
1answer

DispatcherTimer Error

I am writing a Windows Phone 8.1 App (WINRT). I am showing a StatusBar: 1. MYAPP (WELCOME) 2. MYAPP (CONNECTED VIA WIFI) 3. MYAPP (CONNECTED VIA CELLULAR) If user is connected via Wifi, it shows "MYAPP (CONNECTED VIA WIFI)" and if user is connected via cellular, it shows "MYAPP (CONNECTED [...] read more
c#
multithreading
xaml
oop
windows-phone-8.1
2votes
1answer

MS Office Interop - can't release references to RCW

I'm using Microsoft.Office.Interop.PowerPoint in my app to control presentation SlideShow. I can connect to PowerPoint using code PowerPointApp = Marshal.GetActiveObject("PowerPoint.Application") as Microsoft.Office.Interop.PowerPoint.Application; and all works ok, but I can't release refereces (after SlideShow ends and PowerPoint was CLOSED) using Marshal.FinalReleaseComObject(PowerPointApp); This call still throws an exception: A first chance exception [...] read more
c#
.net
com
office-interop
2votes
1answer

XamlReader.Load() Marshalled

I'm trying to generate my own custom tile from xaml. I've converted some code from C++ to C# in order to integrate it into my app. Basically I've got this method: async Task GenerateHighResTileImage(string inputMarkupFilename, string outputImageFilename, Size size) { StorageFolder assetsFolder = await Package.Current.InstalledLocation.GetFolderAsync("Assets"); StorageFile markupStorageFile = await assetsFolder.GetFileAsync(inputMarkupFilename); [...] read more
c#
c++
xaml
windows-phone-8.1
1vote
2answers

Changing the icon in a button based off of MediaPlaybackState

I have a MediaPlayerElement and the following class to control it: class MediaPlayer : INotifyPropertyChanged { private MediaPlaybackState _State; public MediaPlaybackState State { get { return _State; } set { _State = value; OnPropertyChanged(); } } public BitmapImage AlbumArt; public string Title; public string Subtitle; private MediaPlayerElement mediaPlayer; public event [...] read more
c#
uwp
uwp-xaml
1vote
1answer

UnoPlatform -The application called an interface that was marshalled for a different thread

i am using Uno prism template for my Uno platform App. After making an async call in UWP app. i.e. var content = await GetHttpContentWithTokenAsync(graphAPIEndpoint,authResult.AccessToken).ConfigureAwait(false); whenever RaisePropertyChanged() method hits I am getting following error=> {"The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E [...] read more
prism
uno-platform
1vote
1answer

Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSObject100'

whenever i opend my ssis package giving error message Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSObject100'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{30E5D0EF-E33D-4945-8A7F-F5178FC64C24}' failed due to the following error: The application called an interface that [...] read more
sql-server
ssis
1vote
1answer

Implementing Periodic Process in UWP, MVVM

I'm building an small App that gather data from website. and I managed to gather data. Following picture depicts what my app does. enter image description here [https://i.stack.imgur.com/EJSHU.png] when I click the button "시작", my App get html of the specific page, and get data from it. This works are [...] read more
c#
mvvm
uwp
scheduled-tasks
1vote
0answers

SSIS project keeps failing with COM error

On my SSIS project I keep getting a COM error when I open the project, and then everything runs incredibly slow. The message says this: > Uable to case COM object of type 'System.__ComObject' to interface type > 'Microsoft.sqlServer.Dts.Pipeline.Wrapper.IDTSObject100' This operation failed > because the QueryInterface call on the COM [...] read more
ssis
dts
1vote
0answers

HWA: instantiating RenderTargetBitmap throws RPC_E_WRONG_THREAD even in UI thread

I'm trying to use RenderTargetBitmap to get a screenshot of a Windows Hosted Web App (HWA) window, but I can't seem to instantiate it when handling a request from the Javascript web app running on the HWA app: public async Task<IBuffer> CaptureScreenshotToFileAsync(uint thumbnailWidth, uint thumbnailHeight, string fileName) { // Throws [...] read more
c#
uwp
rendertargetbitmap
1vote
0answers

Different thread exception when trying to set IPropertyNotifyChanged using MVVM Light from a secondary window

I'm using MVVM-Light with Windows Template Studio. My app works fine but when i open a view/viewmodel in a separate windows using WTS's WindowManagerService it gives me this error: > "System.Exception: 'The application called an interface that was marshalled > for a different thread. (Exception from HRESULT: 0x8001010E > (RPC_E_WRONG_THREAD))'" [...] read more
c#
uwp
mvvm-light
windows-template-studio
1vote
2answers

Windows IoT Raspberry Pi 3 c# MediaPlayer.mediaEnded

I am new to this. I am trying to do a Audio Message Player on Rasp Pi 3 with Win IoT core. I manage to play audio file from my USB thumbdrive but I need to know when the audio file has completed playing. mediaPlayer = new MediaPlayer(); mediaPlayer.MediaEnded += [...] read more
c#
raspberry-pi
raspberry-pi3
windows-iot-core-10
1vote
1answer

Windows Phone Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)

My Windows Runtime Application reads a NDEF NFC-Tag. When the App reads the NFC-Tag correct my method message receivedwill open. private void messageReceived(ProximityDevice sender, ProximityMessage message) { device.StopSubscribingForMessage(NFCID); var ndefMessage = NdefMessage.FromByteArray(message.Data.ToArray()); StringBuilder sb = new StringBuilder(); foreach (NdefRecord record in ndefMessage) sb.AppendLine(Encoding.UTF8.GetString(record.Payload, 0, record.Payload.Length)); String data= sb.ToString(); ShowData(data); } [...] read more
c#
windows-phone-8
windows-runtime
windows-phone-8.1
windows-phone
1vote
3answers

Update UI from different thread

This is my first question here. As English is not my first language, forgive me for any mistakes. I'm trying to develop an application for Windows Phone 8.1 (XAML and C#) and I'm using .NET Framework 4.5.2. I just started studying multithreading in C# and would appreciate if anyone here [...] read more
c#
multithreading
task
marshalling
1vote
0answers

UWP Error (RPC_E_WRONG_THREAD)

This error probably has been seen so many times and was avoided with some changes in code to run the specific code on UI Thread rather than worker thread. But in my situation the things are different. Problem: In my app, I was not able to implement Incremental Loading because [...] read more
c#
multithreading
uwp
1vote
0answers

UWP kiosk mode app (Task problems)

I have a running uwp app. Now I want to run it in win 10 kiosk mode to avoid that the users can close the app. My app structure is like followes: SplashScreen (LoadingScreen) where I start a awaited task to load all the data form network (approx. 5 min [...] read more
c#
windows-runtime
win-universal-app
1vote
1answer

SSIS Package Connection Manager does not recognize my Teradata drivers

I have Visual Studio 2010, 2012, 2013 installed. I also have the VS2015 SSDT Preview installed. I'm editing some existing SSIS Packages that have Teradata as a source. The properties are set in the connection manager. I have the following Teradata drivers installed: * .NET Data Provider for Teradata 14.11.0.3 [...] read more
visual-studio
teradata
sql-server-data-tools
ssis-2012
ssdt-bi
1vote
1answer

How to write to a file in C#

I am trying to make a program that, at the same time, displays text that the user inputted and writes to a text file of that same user input data. I've tried wrapping the the code with Task.Run: private void button_Click(object sender, RoutedEventArgs e) { show.Text = inputText.Text; //Debug.WriteLine(check1_cont.ToString()); //Debug.WriteLine(check2_cont.ToString()); [...] read more
c#
1vote
0answers

Timer called in wrong interface

I have a Problem with my timer in C#. The Problem is following: > The application called an interface that was marshalled for a different > thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)) Can you help me and solve this? I have no plan. Thank you. Here is my Code: using [...] read more
c#
multithreading
timer
background
1vote
0answers

OpenFileDialog causes "The application called an interface that was marshalled for a different thread"

I have the following code in my C# WinForms application: private void AddFile_Click(object sender, EventArgs e) { OpenFileDialog openFile = new OpenFileDialog(); openFile.RestoreDirectory = false; openFile.Filter = "PCAP files (*.pcap)|*.pcap"; openFile.RestoreDirectory = true; openFile.Multiselect = true; openFile.FilterIndex = lastUsedFileType; if (openFile.ShowDialog() == DialogResult.OK) { lastUsedFileType = openFile.FilterIndex; foreach (string file [...] read more
c#
winforms
0votes
1answer

Solving errors which i get with php and IIS

I am using php 5.0 and IIS 5. When i am trying to access my application i get 2 erros like PHP has encountered an Access Violation at 011173CD and HTTP/1.1 500 Server Error Server: Microsoft-IIS/5.1 Date: Thu, 15 Sep 2011 10:26:36 GMT Content-Type: text/html Content-Length: 44 -2147417842 (0x8001010e) I [...] read more
php
iis
0votes
0answers

Why does the Visual Studio IDE Marshall a static value on the wrong thread but not do it at runtime?

I have an issue where my UWP User Controls cause an exception in (XAML) design mode because the thread is marshalled to the wrong thread? What I have is several controls that use the same Brush and it makes sense that they all use reference value rather than creating many [...] read more
c#
multithreading
visual-studio
uwp
marshalling
0votes
0answers

UWP WebView causing exception

I have a WebView in a Page that is used in a NavigationView. When I swicth to the corresponding tab the following exception is thrown: Exception thrown at 0x75234662 (KernelBase.dll) in MyApp.exe: WinRT originate error - 0x8001010E : 'DispatcherQueueController is already created on this thread.'. I determined it was the [...] read more
xaml
webview
uwp
0votes
0answers

How can I create and modify Xaml UI elements in .cpp files (C++/WinRT)?

I need to make a Xaml UI element in a .cpp file my C++/WinRT project (in also Win32 Desktop and WinUI3, not UWP), but I'm having a threading error. WinRT originate error - 0x8001010E : 'The application called an interface that was marshalled for a different thread.' I think one [...] read more
c++
xaml
winrt-xaml
c++-winrt
winui-3
0votes
1answer

In Xamarin BindingBase.EnableCollectionSynchronization doesn't Work

i get always on Xamarin with UWP the following Error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)) I want to use: Xamarin.Forms.BindingBase.EnableCollectionSynchronization(MyList, null, ObservableCollectionCallback); I won't use: Xamarin.Forms.Device.BeginInvokeOnMainThread(() => MyList.Add(DateTime.Now.ToLongTimeString())); I have my reasons. Here is the very simple c# [...] read more
c#
xamarin.forms
binding
xamarin.uwp
0votes
2answers

API Calls and Fetching Data with C# and Xamarin

So I have a program that Calls an API once the user has entered a search term Like so: LoadTVShows load = new LoadTVShows(); private async void searchShow(object sender, EventArgs e) { searchString = searchBox.Text; try { var getTvShow = await load.GetAPI(searchString).ConfigureAwait(false); } catch { } showName.Text = load.name; showSummary.Text [...] read more
c#
api
xamarin
uwp
0votes
1answer

Universal Windows UI Responsiveness with Async/Await

Please help me understand how to properly await long executing tasks to keep the UI responsive in a Universal Windows application. In the code below OperateSystem is a model class which inherits ObservableObject. OperateSystem.GetLatestDataFromAllDevices connects to a variety of instruments, collects data, and updates class properties with the information from [...] read more
c#
multithreading
uwp
async-await
mvvm-light
0votes
2answers

Correct way to access UI from background thread in UWP

When trying to add data to an ObservableCollection, which is x:Binded in XAML to a ListView on the UI, I get this error:The application called an interface that was marshalled for a different thread (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)) My app implements MVVM. VieModel pulls data with an eventhandler. I [...] read more
c#
uwp
0votes
1answer

Get "The application called an interface that was marshalled for a different thread" error while getting content from Clipboard

Aim: Get content from the clipboard using C++/WinRT APIs. Problem: Since I'm just testing this API, I tried to code a simple console app with the blocking get() method on Clipboard's async text getter. However, I'm getting the "The application called an interface that was marshalled for a different thread" [...] read more
c++
windows
winapi
clipboard
c++-winrt
0votes
1answer

updating UI element after gpio button press

I'm making an application that updates a UI element after a press on a button connected to the GPIO pins. it's my first time working with windows iot core. I thought it would be as easy as this "lblQuestion.Text = "Button works!";" but it isn't. can anyone tell me what [...] read more
c#
raspberry-pi3
windows-iot-core-10
0votes
0answers

How to call a function in a backgroundworker thread that is to be completed on the main UI thread?

I am using a BackgroundWorker to monitor if a bit has flipped on an external device every couple of seconds. I then want it to call a function that is to be run on the main UI thread, but is instead being run on the same thread as the BackgroundWorker. [...] read more
c#
multithreading
uwp
backgroundworker
0votes
1answer

How to fix "marshalled for a different thread Error" on Async ProgressBar in UWP

I'm working on UWP Application which downloads images from the server asynchronously, Image downloading part works perfect and I am able to display thumbnails of the downloading image groups. My Problem is showing a progress bar as I download these images. I know you need to use Dispatcher in order [...] read more
c#
asynchronous
uwp
progress-bar
0votes
1answer

How to solve task execution problem with thread?

I am creating an application that uses two threads, one for the whole UI and the other for the background task that retrieves the data received by the serial link. When launching my application, an extended splash screen is displayed, to unlock it and go to the main page, the [...] read more
c#
visual-studio
xaml
uwp
0votes
2answers

How to get a certain UI control from two classes

I'm developing a UWP application with two window pages on two separate screens. It's include: * Mainpage.xaml * Mainpage.xaml.cs * Page2.xaml * Page2.xaml.cs My scenario: 1. get the mouse position(X) while moving on the secondary screen (Page2). 2. write it in the text block on the first screen (MainPage), Changing [...] read more
c#
xaml
uwp
0votes
1answer

UWP. Trying to async download pictures and get System.Exception: Calling Async synchronously, 'marshalled for a different thread'

if interface need a picture it saves request in ConcurrentDictionary<key, Delegate> and when picture is on the disk read it and SavedDelegate?.Invoke(key, byte[]). But there is an error in this place: private async void OnDelegateInvokeAsync(ImageItem item, byte[] body) { ... item.Image = new BitmapImage(); ... } > System.Exception: Calling Async [...] read more
multithreading
uwp
0votes
0answers

Troubles with Multithreads and Messaging Center in Xamarin.forms

I'm developing another sample where Messaging Center send status messages not coupled from device code to my view models. At this point I used: * A alert message; * Label in my view; * A method by dependency injection from native code(interfaced and created before). To notice the events before [...] read more
c#
multithreading
xamarin.forms
uwp
thread-safety
0votes
1answer

why windows 10 UWP app is crashing due to The application called an interface that was marshalled for a different thread?

I have a windows 10 UWP app and hockey app SDK integrated in it. I am unable to find the exact reason why app is crashing. I am providing the Hockey app crash log, please help me to fix the issue. This is happening after installing and opening the app [...] read more
uwp
windows-10-universal
uwp-xaml
xamarin.uwp
hockeyapp
0votes
2answers

How can I start a UWP (Xaml) application from a Core application in its own thread?

I would like to have both a UWP xaml application (called my_xaml_app) and a UWP Core application (called my_core_app) running in the same program in their own respective thread. So far I have tried the following approach: my_core_app::my_core_app() { ViewProviderFactory viewProviderFactory; winrt::Windows::ApplicationModel::Core::CoreApplication::Run(viewProviderFactory); } winrt::Windows::Foundation::IAsyncAction init_core_app() { co_await winrt::resume_background(); my_core_app coreApp; [...] read more
xaml
uwp
com
c++-winrt
0votes
1answer

Thread Error while updating UI by calling method from IOT Hub

I am very new to C# and Azure IoT. Perhaps the problem I have is very simple to solve. I would like to update the an UI Element by invoking a method from the cloud. But I am getting the following Error: > The application called an interface that was [...] read more
c#
azure
asynchronous
iot
azure-iot-hub
0votes
1answer

How to solve "The application invokes an interface that has been organized for another thread"

I have a UWP application, I want to use the method in MainPage.xaml.cs in App.xaml.cs, for some reason, the method in MainPage.xaml.cs can't be declared to be static, so I instantiate the MainPage class in App.xaml.cs, but throw the following exception: > The application invokes an interface that has been [...] read more
c#
uwp
0votes
0answers

Accessing UI thread from Windows Runtime Component throws exception only on Mobile

I have the following problem. I am using a simple Windows Runtime Component to communicate between the application and a WebView. I am doing this according to documentation This is the code for the Windows Runtime Component public delegate void NotifyAppHandler( string str ); [AllowForWeb] public sealed class WebViewInjectionObject { [...] read more
c#
webview
uwp
ui-thread
winrt-component
0votes
1answer

Display images in UWA that is not from App Assets

I've some hard time trying to display images in my UWP App. My images are located in the Images library. The question is: How to show jpg in the Image Xaml control on a UWP, that is not in the projects "Assets"? So far using Binding, I’ve * Try to [...] read more
c#
image
uwp
visual-studio-2017
0votes
0answers

Extending TextBox throws RPC_E_WRONG_THREAD exception

I'm creating a DelayedTextbox. I did this by extending the TextBox and adding dependency properties (thanks to help on another question) So I have a cs file that looks like this: public class DelayedTextBox : TextBox { public int Delay { get { return (int)GetValue(DelayProperty); } set { SetValue(DelayProperty, value); [...] read more
xaml
uwp
uwp-xaml
0votes
0answers

SpeechRecognizer - The application called an interface that was marshalled for a different thread

I'm trying to make a simple speech controlled app, that is activated like cortana. When I speak something specific like "banana" I want the app to listen for commands. Here is my code: public async Task SetupRecognizer() { var WebGrammar = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.WebSearch, "webSearch"); Recognizer.Timeouts.InitialSilenceTimeout = TimeSpan.FromSeconds(6.0); Recognizer.Timeouts.BabbleTimeout = TimeSpan.FromSeconds(4.0); [...] read more
c#
exception
speech-recognition
0votes
1answer

uwp multi views update GridView

Thanks in advance. as I know, The first view that’s created when your app starts is called the main view, and Other views, including all views that you create by calling CreateNewView in your app code, are secondary views. I also know, I can't update UI in thread if they [...] read more
c#
multithreading
uwp
0votes
1answer

Exception about SoftwareBitmapSource in UWP Code

What's wrong with this code? private async void FrameMonitor_PartEvent(object sender, MonitorParam monitorParam) { SoftwareBitmap bmp = new SoftwareBitmap(BitmapPixelFormat.Bgra8, (int)monitorParam.WP_FrameInfo.ImageWidth, (int)monitorParam.WP_FrameInfo.ImageHeight, BitmapAlphaMode.Ignore); IBuffer buffer = WindowsRuntimeBufferExtensions.AsBuffer(monitorParam.WP_FrameBytes); bmp.CopyFromBuffer(buffer); SoftwareBitmapSource bmpsource = new SoftwareBitmapSource(); await bmpsource.SetBitmapAsync(bmp); await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, async () => { Img_WPImg.Source = bmpsource; }); bmp.Dispose(); } On this code: SoftwareBitmapSource bmpsource [...] read more
uwp
win-universal-app
uwp-xaml
0votes
1answer

How to change Property out of DevicePicker.DeviceSelected Event in Command

I have a ConnectButton binded to a Command. In his Command Im calling the DevicePicker and set the DeviceSelected Event to a method. private void connectButtonCommand() { DevicePicker myDevicePicker = new DevicePicker(); myDevicePicker.Show(new Rect(10, 10, 200, 200)); //myDevicePicker.Filter.SupportedDeviceSelectors.Add(BluetoothDevice.GetDeviceSelectorFromPairingState(false)); myDevicePicker.Filter.SupportedDeviceSelectors.Add(BluetoothDevice.GetDeviceSelectorFromPairingState(true)); myDevicePicker.DeviceSelected += MyDevicePicker_DeviceSelected; } and the Method private async void MyDevicePicker_DeviceSelected(DevicePicker [...] read more
mvvm
properties
binding
uwp
command
0votes
0answers

Script Component failed the post-execute phase and returned error code 0x80004002

SSIS pakage throw an errror "**[SSIS.Pipeline] Error: Script Component failed the post-execute phase and returned error code 0x80004002. **" In Script component its shows task run successfully but Control flow task shows Error. Control flow task [https://i.stack.imgur.com/GH197.png] Data flow Task [https://i.stack.imgur.com/4UmGD.png] Here is my Script task Code: public override void [...] read more
c#
ssis
0votes
0answers

UWP Background Task Operation Error

I am programming for UWP with C# language. I am reading about background task and create and register an in-process background task. The registration code of background Task: public static async Task RegisterBackgroundTask() { // // Check for existing registrations of this background task. // foreach (var cur in BackgroundTaskRegistration.AllTasks.Values) [...] read more
c#
uwp
0votes
1answer

UWP adding UI control to list in non-uit thread

So as i'm learning more and more stuff of UWP and XAML i bumped into two issues, one is (i think) "navigation" related and the second a threading issue. What i'm trying to achieve is simple. I have two pages, one "home" and one "Settings". On the Home page i [...] read more
vb.net
multithreading
binding
navigation
uwp
0votes
1answer

UWP C# How to change Xaml UI rectangle fill outside of MainPage in async method?

(Windows 10, UWP, C#, XAML) I'm trying to change a rectangle's Fill from a class that is not the main method. I've sent my rectangle to the other class and from there I can set it's Fill. However, I need the Fill to change during an ongoing asynchronous method (rather, [...] read more
c#
xaml
asynchronous
uwp
windows-10
0votes
1answer

Setting a ViewModel UI Property from an Async Method

I am trying to set a ViewModel List property from an async method, but this ends with the following error: > {"The application called an interface that was marshalled for a different > thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))"} The error is pretty clear. What is not clear to me [...] read more
c#
mvvm
uwp
mvvm-light
0votes
1answer

Marshalling exception with code from the ShareTarget second window

I'm having a hard time with some code I have that apparently struggles when called from the second window created by the ShareTarget contract (when you share something to the app, it opens in a small standalone window). This is my code so far: // Blur and resize the image [...] read more
c#
xaml
windows-runtime
uwp
lumia-imaging-sdk
0votes
0answers

How can I add many UserControls to StackPanel without freeze?

i try to develop a equivalent to a android app (just for fun / 2 learn) and i try to add round about 3500 UserControls to my GUI in a StackPanel. One UserControl contain 2 textblocks (titel and subtitle), two buttons and one image. If i add the controls in [...] read more
c#
multithreading
user-controls
async-await
uwp
0votes
1answer

Update UI from another GPIOListener class

I'm developing an application with windows-10-t platform on raspberry-pi3. The application has several pages and listens GPIO ports asyncrhonously in the background. It collects data from GPIO and sends to the WCF-Service, after a bit the UI should be updated by the data coming from the WCFService. I've also tried [...] read more
c#
asynchronous
gpio
raspberry-pi3
windows-10-iot-core
0votes
1answer

ValueConverter for StorageFile => Image

I'm trying to use MVVM for a Universal Windows project but the interfaces for Storage File complains a lot about using async. The following code sometimes works: public object Convert(object value, Type targetType, object parameter, string language) { var storageFile = value as StorageFile; return GetImageAsync(storageFile).Result; } private static async [...] read more
c#
async-await
uwp
win-universal-app
storagefile
0votes
1answer

Can't show Dialog box in windows phone 8.1

i am devloping a qrcode scanner custom app for windows phone 8.1. i am using the Nokia Imaging SDK to render the back camera so as to preview the QRCode image, after decoding, i cant display a message dialog. it throws the following exception: > The application called an interface [...] read more
c#
windows-phone-8.1
0votes
0answers

How to call all sub-called methods on the same thread which different from the main thread?

I have the following sceanrio: void Method_A() { Method_B(); } void Method_B() { Method_C(); } Now I do this: Thread myThread = new Thread(Method_A); myThread.Start(); and I get the following exception: > This operation failed because the QueryInterface call on the COM component for > the interface with IID '{9149349D-5A91-11CF-8700-00AA0060263B}' [...] read more
c#
multithreading
0votes
2answers

MapIcon creation in Timer callback

I'm creating a small universal windows application. I'd like to use MapControl to present some data downloaded from the Internet. This data refreshes every minute and I want to update MapIcons positions everytime that it happens. So... After loading a map, I create a Timer that runs every 60 seconds [...] read more
c#
multithreading
timer
win-universal-app
0votes
1answer

Dispatcher.RunAsync (The application called an interface that was marshalled for a different thread.)

The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)) enter image description here [https://i.stack.imgur.com/EbD75.jpg] In one of my Views I instantiate an options view within it. Not sure if the options of should be an entirely separate object or not. When the [...] read more
c#
multithreading
winforms
0votes
1answer

WriteableBitmap inside Windows 10 IBackgroundTask

I am trying to crop an image from a Run method from Windows 10 app (UWP) IBackgroundTask. To achive that I'm using the WriteableBitmapEx but at the moment that I try to instantiate a new object, I got the exception: > The application called an interface that was marshalled for [...] read more
windows-10
uwp
windows-10-universal
0votes
1answer

How to update listbox with ObservableCollection data in Win RT

I am trying to update listbox form ObservableCollection but don't know what am doing wrong that i always get the exception below. i am new to winRT. > The application called an interface that was marshalled for a different > thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)) <ListBox x:Name="UserList" HorizontalContentAlignment="Stretch" Margin="12,41,12,12"> [...] read more
c#
listview
listbox
windows-runtime
0votes
1answer

System.Exception - Maybe something to do with my timer

So I have come to a problem that I have never had before and I cant find any information about my specific problem. Basically when i start the program i have a panel that displays time and weather information. When i start it, the weather is refreshed as well as [...] read more
c#
windows
0votes
1answer

COM 0x8001010E error when invoking from a new thread

I have a c++ DLL that uses an IDispatch interface to invoke methods on a third party DLL. It works if I invoke those methods from the original thread but if a new thread is started (not the one CoCreateInstance was called on) to invoke the method after the it [...] read more
c++
windows
com
0votes
3answers

How to Bind Listbox in windows phone 8.1

I want to bind listbox in windows phone app 8.1. I am using following code but It raise an error : > Additional information: The application called an interface that was > marshalled for a different thread. (Exception from HRESULT: 0x8001010E > (RPC_E_WRONG_THREAD)). I am using the following code private [...] read more
c#
windows-phone-8.1
0votes
1answer

MediaElement.CurrentState retrieves System.Exception

I need to get the CurrentState from a MediaElement several times. I've created a simple function that looks like this: private string getCurrentState(MediaElement m) { return m.CurrentState.ToString(); } But everytime this function is called I get this: > An exception of type 'System.Exception' occurred in MyProject but was not > [...] read more
c#
windows-10
c#-5.0
windows-10-mobile
0votes
1answer

Is there a restriction on using a BitmapImage (or other UI namespace classes) on a none- UI thread?

I'm doing some cloud operations involving a BitmapImage in my code, and on the response (basically a none-UI thread for sure) I'm getting a "The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))" on - BitmapImage cImage = new BitmapImage(); AFAK this [...] read more
c#
windows-store-apps
0votes
1answer

Error while navigating from extended splash screen in WP8.1RT

I used this method (from msdn) to extend splashscreen in my app but while navigating after showing extended splash screen it is throwing error. Error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)) Code: void DismissedEventHandler(SplashScreen sender, object e) { dismissed [...] read more
windows-runtime
windows-phone-8.1
splash-screen
0votes
1answer

Incrementally loading items in a listview

I have adopted the following example from MSDN for incrementally loading thumbnails in a list view in an WinRT App: https://code.msdn.microsoft.com/windowsapps/Data-Binding-7b1d67b5 I would like to remove the "await Task.Delay(10)" line below. When I do, I get a warning that the method lacks an await operator. protected async override Task<IList<object>> LoadMoreItemsOverrideAsync(System.Threading.CancellationToken [...] read more
c#
winrt-xaml
winrt-async
0votes
1answer

VSTO with Windows Form and Worker Threads

I have an Office addin (Outlook if it makes a difference) created with VSTO. The addin creates a Windows Form at startup. My Form creates several threads. I'm looking for either concrete guidance or peoples' experiences with what safely works for the following situations: 1.) A thread created by the [...] read more
c#
winforms
outlook
ms-office
vsto
0votes
1answer

RaisePropertyChanged and different thread

I have problem with failing RaisePropertyChanged in my application. It is called after receiving message from another class. This message is sent after await calling. var storedData = await localFolder.GetFileContentAsync("data.json").ConfigureAwait(false); if (!string.IsNullOrEmpty(storedData)) { snags = JsonConvert.DeserializeObject<Data>(storedData); messenger.Send(new ChangeDataCountMessage()); } Failing RaisePropertyChanged public Data DataProperty { get { return dataProperty; } [...] read more
c#
xaml
async-await
mvvm-light
0votes
1answer

Unintentional Multi-threading in Windows Runtime

I am working with a SettingsPane that holds settings, and I have all my problems solved - except for one thing I apparently have no control over. This is the relevant SettingsPane.xaml: <ComboBox Name="Themes" SelectionChanged="SettingSelectionChanged"> <ComboBoxItem Content="Theme 1" /> <ComboBoxItem Content="Theme 2" /> <ComboBoxItem Content="Theme 3" /> </ComboBox> This is [...] read more
c#
windows-runtime
winrt-xaml
-1votes
1answer

WPF Binding brush generates marshalling error

I'm quite confused as at runtime I get this error: The application called an interface that was marshalled for a different thread. (0x8001010E (RPC_E_WRONG_THREAD))' I have a on object that has: <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <TextBlock Grid.Column="0" FontFamily="Segoe MDL2 Assets" Foreground="{Binding ImageColor, Mode=OneWay}" Text="{Binding ImageSrc, [...] read more
wpf
data-binding
colors
runtime-error
marshalling
-1votes
2answers

UWP c# Accessing a MainPage Textblock from a class

On a Mainpage XAML I have a CommandBar that I use to display the application main buttons and a message area. It looks a bit like this: <CommandBar x:Name="topcmdbar" Grid.Column="0 " Grid.ColumnSpan="3" IsDynamicOverflowEnabled="False" ClosedDisplayMode="Compact" VerticalAlignment="Top" Opacity=".5" Background="Transparent" Visibility="Visible" > <CommandBar.Content> <Grid > <TextBlock x:Name="TopCmdBarContent" x:FieldModifier="public" HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Stretch"/> </Grid> </CommandBar.Content> [...] read more
c#
class
xaml
user-interface
uwp
-1votes
1answer

Start async tasks on app start, await on later button click

I have a Windows 10 UWP application that I want to start intialising some classes asap, and only later need them to be complete. I am new to multithreaded programming so apologies for apparent stupidity of my approach. I started a task in the App constructor, assigning the task to [...] read more
c#
multithreading
uwp
-1votes
4answers

Service throws an exception when trying to call a COM library

I'm writing an application that uses a COM library. I have a class library that wraps the calls to the COM library and adds some more functionality. Eventually this will run as a Windows Service. For now I test it using a Winforms test harness. When the class library is [...] read more
c#
.net
windows-services
error-handling
-1votes
1answer

Pushing (Push-)buttons causes exceptions

today I've got a special problem. I have a Raspberry Pi running Win10IoT, with a pushbutton connected to GPIO6. In my App, there's an Ellipse, which should be painted red, when the button is pressed. It worked.. until today! I've added a MediaElement with a simple ComboBox to load some [...] read more
c#
exception
raspberry-pi
uwp
-1votes
1answer

WP8.1 C# Windows Phone 8.1 Background Task WriteableBitmap Thread Error

I am trying to update the band Me Tile image from a background task and i get the following error at WriteableBitmap: System.Exception: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)) at Windows.UI.Xaml.Media.Imaging.WriteableBitmap..ctor(Int32 pixelWidth, Int32 pixelHeight) at BackgroundTaskCS.UpdateBandTask.<LoadImage>d__f.MoveNext() --- End of [...] read more
c#
writeablebitmap
background-task
microsoft-band
-2votes
1answer

Exception thrown when use await Task.Run() in UWP

I used two Task.Run. In the first one everything works correctly, but in the second an exception is thrown: > Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD). I do not understand how to solve it. I would like to understand from the code that the Task.Run returns a TextHighlighter. What is the [...] read more
c#
uwp
task
-2votes
1answer

C#: Error with PivotItem creation

After PivotItem pivotItem = new PivotItem(); I'm getting Additional information: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)). What should it be? I'm pretty confused of it. Code: foreach (Source source in sources) { PivotItem pivotItem = new PivotItem(); /* At [...] read more
c#
win-universal-app
-2votes
2answers

How to prevent marshalling errors when accessing UI elements from non-UI threads?

I've got this function that receives a digital output pin address uscita as Integer and status high as boolean, and updates the pin-out and fills color red in a LED-like Ellipse on the UI. Private Function comandaUscita(ByVal uscita As Integer, ByVal high As Boolean) As Boolean If high Then Select [...] read more
vb.net
uwp
windows-10-iot-core
-5votes
1answer

C# - How to set the property to Ui Thread

I'm getting an error (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)). What should be the problem here, my senior dev said I need to set it to the UI Thread, here's my code: private bool CanPrintReceipt() { return _receipt != null && !IsBusy; } private async void PrintReceipt() { IsBusy = true; [...] read more
c#
uwp

Comments

Leave a comment

(plain text only)

Sources

  1. winerror.h from Windows SDK 10.0.14393.0
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0