Posts Tagged ‘STA’


PowerShell Studio: Knowing when to use STA mode

Monday, March 9th, 2015 by David Corrales
Follow @SAPIENDavid Recently, on our forums, a user asked why certain controls didn’t function correctly or threw an error when he unchecked the STA option in PowerShell Studio. STA (Single Threaded Apartment) and MTA (Multi-Threaded Apartment) determine how a process manages legacy COM objects and their communication with multiple threads. I will not go into the detail, but you need not concern yourself with the inner workings of COM objects, other than to remember that STA is required for some of the GUI controls to function correctly. If you're interested in the details, see Processes, Threads, and Apartments in the…   More »

PrimalForms 2009: New Packager STA Mode

Wednesday, November 18th, 2009 by David Corrales
Last month’s service build included a new addition to PrimalForms 2009’s packager: STA Mode (Single Thread Apartment), which allows you to perform operations that may have previously failed, such as accessing Window’s Clipboard. Some of you may have attempted to use the Clipboard in your forms only to encounter issues within PowerShell. For example, if you try to copy data from a DataGrid you will get the following error: This issue also comes up if you try to access the Clipboard directly from within Powershell: [System.Windows.Forms.Clipboard]::SetText("Paste this text to the clipboard") These issues arise because PowerShell runs in a MTA…   More »