Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. [STAThread] ?

[STAThread] ?

Scheduled Pinned Locked Moved C#
question
9 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ruanr
    wrote on last edited by
    #1

    Hi, I often see [STAThread] above the main method of other people's classes, but I honestly have no idea what it does :) someone willing to enlighten me? (I know its static thread, but what does it DO?)

    M M V H 4 Replies Last reply
    0
    • R ruanr

      Hi, I often see [STAThread] above the main method of other people's classes, but I honestly have no idea what it does :) someone willing to enlighten me? (I know its static thread, but what does it DO?)

      M Offline
      M Offline
      Martin 0
      wrote on last edited by
      #2

      Hello, It marks the main entry point for the application. Your programm will start at this point, in the main thread. All the best, Martin -- modified at 3:59 Monday 9th July, 2007 my spam message for today!

      R S 2 Replies Last reply
      0
      • R ruanr

        Hi, I often see [STAThread] above the main method of other people's classes, but I honestly have no idea what it does :) someone willing to enlighten me? (I know its static thread, but what does it DO?)

        M Offline
        M Offline
        Michael Sync
        wrote on last edited by
        #3

        it just make ur app as "Single-Threaded apartment"

        Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

        1 Reply Last reply
        0
        • M Martin 0

          Hello, It marks the main entry point for the application. Your programm will start at this point, in the main thread. All the best, Martin -- modified at 3:59 Monday 9th July, 2007 my spam message for today!

          R Offline
          R Offline
          ruanr
          wrote on last edited by
          #4

          Isn't that what the Main method is for?

          M 1 Reply Last reply
          0
          • M Martin 0

            Hello, It marks the main entry point for the application. Your programm will start at this point, in the main thread. All the best, Martin -- modified at 3:59 Monday 9th July, 2007 my spam message for today!

            S Offline
            S Offline
            Stephen Hewitt
            wrote on last edited by
            #5

            It's not for marking the entry point but rather specifying the threading model. See here[^] for some details.

            Steve

            M 1 Reply Last reply
            0
            • R ruanr

              Isn't that what the Main method is for?

              M Offline
              M Offline
              Martin 0
              wrote on last edited by
              #6

              You are write it's an Attribute for the Main method. Which marks it as "Single-Threaded apartment" like 'Michael Sync'[^] said befor! -- modified at 3:55 Monday 9th July, 2007

              1 Reply Last reply
              0
              • S Stephen Hewitt

                It's not for marking the entry point but rather specifying the threading model. See here[^] for some details.

                Steve

                M Offline
                M Offline
                Martin 0
                wrote on last edited by
                #7

                Hallo, Thank's for the link. I shouldn't replay out of a hurry, I know! :~ A quite lousy statement from me. Sorry for that! All the best, Martin

                1 Reply Last reply
                0
                • R ruanr

                  Hi, I often see [STAThread] above the main method of other people's classes, but I honestly have no idea what it does :) someone willing to enlighten me? (I know its static thread, but what does it DO?)

                  V Offline
                  V Offline
                  Vasudevan Deepak Kumar
                  wrote on last edited by
                  #8

                  Single Threaded Apartment Check out this http://blogs.msdn.com/jfoscoding/archive/2005/04/07/406341.aspx[^]

                  Vasudevan Deepak Kumar Personal Homepage Tech Gossips

                  1 Reply Last reply
                  0
                  • R ruanr

                    Hi, I often see [STAThread] above the main method of other people's classes, but I honestly have no idea what it does :) someone willing to enlighten me? (I know its static thread, but what does it DO?)

                    H Offline
                    H Offline
                    Hesham Yassin
                    wrote on last edited by
                    #9

                    this threrad is for keeping updating the GUI of your form i think!

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups