Results 1 to 4 of 4

Thread: [STAThread]

  1. #1

    Thread Starter
    Lively Member Cagez's Avatar
    Join Date
    Oct 2002
    Posts
    121

    [STAThread]

    WhenI start a new windows app, this code is automatically put in near the bottom of the code. What is it? I've taken out the line and the app still runs, just wondering why the designer puts it there.

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    [STAThread]

    Single Threaded Apartement Thread
    \m/\m/

  3. #3

    Thread Starter
    Lively Member Cagez's Avatar
    Join Date
    Oct 2002
    Posts
    121
    What is it (what is it used for) / do i need it?

  4. #4
    Lively Member
    Join Date
    Aug 2002
    Posts
    126
    it is for COM interoperability.
    if u have some experience writing COM objects, u probably recall COM Threading Model (aka COM Apartment Model).
    basically, if u need the Win Form to run also in unmanage code (eg COM client) leave that attribute as it is, if not, u can remove it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width