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
}
이것이 도움이 될 수 있습니다. http://stackoverflow.com/questions/127188/could-you-explain-sta-and-mta –