Mhhhh... What does <MTAThread> actually do....
Mhhhh... What does <MTAThread> actually do....
Mhhhh... What does <MTAThread> actually do....
Mhhhh... What does <MTAThread> actually do....
Mhhhh... What does <MTAThread> actually do....
Mhhhh... What does <MTAThread> actually do.... Mhhhh... What does <MTAThread> actually do.... Mhhhh... What does <MTAThread> actually do.... Mhhhh... What does <MTAThread> actually do.... Mhhhh... What does <MTAThread> actually do.... Mhhhh... What does <MTAThread> actually do.... Mhhhh... What does <MTAThread> actually do.... Mhhhh... What does <MTAThread> actually do....
Mhhhh... What does <MTAThread> actually do.... Mhhhh... What does <MTAThread> actually do....
Mhhhh... What does <MTAThread> actually do....
Go Back  Xtreme Visual Basic Talk > > > Mhhhh... What does <MTAThread> actually do....


Reply
 
Thread Tools Display Modes
  #1  
Old 06-17-2010, 02:52 AM
CrashPilot CrashPilot is offline
Regular
 
Join Date: Jun 2009
Location: Netherlands
Posts: 73
Default Mhhhh... What does <MTAThread> actually do....


I see it often declared in front of main functions and after reading the MSDN comment on the matter, it's purpose still eludes me. As far as i can understand it has to do with setting the program into some form of multithreaded state. But what does that even mean?

When should I use it, why should I use it, is it even currently relevant becouse i read somewhere that the default apartment state is MTA nowaday's

... What's it's purpose mister Anderson ...
__________________
-- I divided by zero... and survived --
Reply With Quote
  #2  
Old 06-17-2010, 04:10 AM
PlausiblyDamp's Avatar
PlausiblyDampMhhhh... What does &lt;MTAThread&gt; actually do.... PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

It is really just there for COM interop and serves no purpose if you aren't working with COM.

The two attributes MTAThread and STAThread just set your application's default when it comes to dealing with COM objects.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
Reply

Tags
matrix, multithreading


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Mhhhh... What does &lt;MTAThread&gt; actually do....
Mhhhh... What does &lt;MTAThread&gt; actually do....
Mhhhh... What does &lt;MTAThread&gt; actually do.... Mhhhh... What does &lt;MTAThread&gt; actually do....
Mhhhh... What does &lt;MTAThread&gt; actually do....
Mhhhh... What does &lt;MTAThread&gt; actually do....
Mhhhh... What does &lt;MTAThread&gt; actually do.... Mhhhh... What does &lt;MTAThread&gt; actually do.... Mhhhh... What does &lt;MTAThread&gt; actually do.... Mhhhh... What does &lt;MTAThread&gt; actually do.... Mhhhh... What does &lt;MTAThread&gt; actually do.... Mhhhh... What does &lt;MTAThread&gt; actually do.... Mhhhh... What does &lt;MTAThread&gt; actually do....
Mhhhh... What does &lt;MTAThread&gt; actually do....
Mhhhh... What does &lt;MTAThread&gt; actually do....
 
Mhhhh... What does &lt;MTAThread&gt; actually do....
Mhhhh... What does &lt;MTAThread&gt; actually do....
 
-->