2011-03-23 3 views
0

내 프로젝트에 다음과 같은 코드가 약간 있습니다. STA 스레드의 용도는 무엇입니까? STA에 대해 알고있는 것은 Single Threaded Apartment이므로 COM 구성 요소를 사용할 때만 필요합니다. 응용 프로그램의 기본 항목에 사용됩니다.STA thread in windowapplication

/// <summary> 
     /// The main entry point for the application. 
     /// 
     /// Command line: 
     /// Leaf.exe /s server-name 
     /// </summary> 
     [STAThread] 
     static void Main() 
     { 

       Application.EnableVisualStyles(); 
       Application.SetCompatibleTextRenderingDefault(false); 
       Application.DoEvents(); 
       Application.Run(new Leaf()); // Leaf is a constructor 

     } 
+0

이것이 도움이 될 수 있습니다. http://stackoverflow.com/questions/127188/could-you-explain-sta-and-mta –

답변

0

MSDN answers your questions

그것은 다른 기능에 영향을주지 않습니다. 프로그램에서 COM interop을 사용하는 경우에만 효과가 있습니다.

+0

감사합니다. Application.EnableVisualStyles() etcc .. – peter