Questions tagged [sta]

Single-Threaded Apartment of the Component Object Model (COM), as opposed to MTA

STA refers to the Single-Threaded Apartment of Microsoft's Component Object Model (COM). Its opposite is the Multiple Threaded Apartment (MTA), but there is also a Neutral Apartment.

Related tags:

References:

230 questions
0
votes
1 answer

The calling thread must be STA, because many UI components require this

I know, there are a lot of similar questions on SO. But I have pretty strange situation: I get this exception while it is executed inside Dispatcher.CurrentDispatcher.Invoke. I have no idea how to fix it. Here is my StackTrace (you can see…
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266
0
votes
0 answers

Catastrophic failure(Exception HRESULT: 0x8000FFFF (E_UNEXPECTED)) while trying to use MS WebView2 in ASP,NET Web API in production environment

I'm getting 'Catastrophic failure(Exception HRESULT: 0x8000FFFF (E_UNEXPECTED))' run-time error while trying to use MS WebView2 in ASP.NET Web API in production environment (Win10, IIS v.20H2 (OS Build 19042, 1586)) - see details in the code…
ShamilS
  • 1,410
  • 2
  • 20
  • 40
0
votes
2 answers

C# Timer for STAThread COM calls in a Console App

I have a console application that needs to fire a method that uses COM. The program starts with [STAThread]. The program executes correctly when not using a timer process, but apparently suffers from blocking back to the console when using a…
opherko
  • 141
  • 3
  • 6
0
votes
2 answers

Parallel running Progress Bar "Indeterminate" on Login in WPF

Can someone help me on following problem ? I want to show a "Progress Bar" that is "Indeterminate = TRUE" while the user is connecting to SSH server. If the the connection to the server is successfull, then the MainWindow with progressbar should be…
Trex98HD
  • 3
  • 2
0
votes
0 answers

Can a WPF Application be hosted on a thread separate from the UI thread?

I'm working on a project to integrate WPF Windows into a large application written in Visual FoxPro. The project has been progressing for a couple of years with success. One downside to this project is the limitation of the UI thread. FoxPro is an…
RMart
  • 548
  • 1
  • 5
  • 20
0
votes
1 answer

What is STA/MTA vs apartments/free threads vs UI threads/worker threads? Why the name changes?

I am reading Inside COM by Dale Rogerson, and it uses the terms apartment threads and free threads to describe the different types of COM threads. He also clarifies that these correspond directly to UI threads and worker threads: COM uses the same…
citelao
  • 4,898
  • 2
  • 22
  • 36
0
votes
1 answer

B2C Custom Policy LoadUri against a CDN fails to load signin form

We have a B2C with custom policies for sign Up, Sign In and Social login, the base page layout is loaded from a CDN (base.html) our custom page layout is as simple as this:
Juanma Feliu
  • 1,298
  • 4
  • 16
0
votes
0 answers

call a method on a still running thread

I have a WPF Application running on a STA thread that I can't seem to close, the Start and the Stop goes through a singleton class, and the idea is use It wherever I want in my project with Context.Instance.Start()or Context.Instance.Stop() the…
ihisham
  • 248
  • 1
  • 10
0
votes
0 answers

Re-issuing COM call on the UI thread

I am trying to decipher the paragraph below, taken from a blog post here which describes COM history in the context of the development for the Visual Studio IDE: When everything was C++ native code, COM ensured that almost everything happened on…
Sabuncu
  • 5,095
  • 5
  • 55
  • 89
0
votes
1 answer

IDE contoller not found in viirtual box

Iam following the tutorial here. Tutorial Image(IDE controller is shown) In my virtual box I cannot find the IDE controller mentioned here.
Sasi
  • 1
  • 1
0
votes
0 answers

Current thread dispatcher creation fails on new STA thread

I have a Windows service running under the Local System account that analyses XPS documents. On one machine creating the dispatcher on the analysis thread always fails, but on all the other machines we've tried it has worked without any…
Redwood
  • 66,744
  • 41
  • 126
  • 187
0
votes
2 answers

PowerShell: Launch a script as -Sta and Administrator

I have a .ps1 script that I need to launch in Powershell v2.0. Because of this, I use a shortcut file to launch it in Sta mode: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Sta -File "C:\TestFile.ps1" This launches Powershell in Sta…
0
votes
1 answer

STA thread in windowapplication

I have a bit of code in my project like shown below,here what is the usage of STA thread ? What i know about STA is it is Single Threaded Apartment,it is only required when using COM components.And it is used in the main entry of the…
peter
  • 8,158
  • 21
  • 66
  • 119
0
votes
2 answers

.Net Core web application running STA thread

I would like to run GET method in controller in STA mode. For Web API this worked perfectly: http://ryanhaugh.com/archive/2014/05/24/supporting-sta-threads-in-web-api/ Can it be translated to .NET Core?
M_T
  • 71
  • 1
  • 10
0
votes
1 answer

Opening a new WPF Window before WaitForExit() without making the window stuck

I'm developing a WPF Application. Right now I'm trying to do something like this: //Print the information about what happened, and open toolbar. MessageBox.Show("Cannot find the destination file, The application will now open…
Erez Shlomo
  • 2,124
  • 2
  • 14
  • 27