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 / C++ / MFC
  4. Thread

Thread

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
14 Posts 7 Posters 3 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.
  • D Davitor

    Hi all How can i call funtion in thread .I need simple Thread example.Plz help me

    C Offline
    C Offline
    Chandrasekharan P
    wrote on last edited by
    #2

    I really think you should search the net before sending a query. Hope this link helps you http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=435[^]

    D 1 Reply Last reply
    0
    • D Davitor

      Hi all How can i call funtion in thread .I need simple Thread example.Plz help me

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #3

      Here[^] is an excellent article about worker threads. A bit long but very interesting.

      Cédric Moonen Software developer
      Charting control [v1.5] OpenGL game tutorial in C++

      D 1 Reply Last reply
      0
      • C Chandrasekharan P

        I really think you should search the net before sending a query. Hope this link helps you http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=435[^]

        D Offline
        D Offline
        Davitor
        wrote on last edited by
        #4

        thank for reply but i need to pass myfunction in thread.Simple i want to create a thread and in this thread i want to pass

        Copy Function

        .Plz help me

        C 1 Reply Last reply
        0
        • D Davitor

          thank for reply but i need to pass myfunction in thread.Simple i want to create a thread and in this thread i want to pass

          Copy Function

          .Plz help me

          C Offline
          C Offline
          Cedric Moonen
          wrote on last edited by
          #5

          What do you mean by "pass myfunction in thread" ? Do you mean that you have to call your function from within the thread ? If yes, you need to make sure that your function prototype is the same as the one expected by the CreateThread function (see here[^]).

          Cédric Moonen Software developer
          Charting control [v1.5] OpenGL game tutorial in C++

          1 Reply Last reply
          0
          • C Cedric Moonen

            Here[^] is an excellent article about worker threads. A bit long but very interesting.

            Cédric Moonen Software developer
            Charting control [v1.5] OpenGL game tutorial in C++

            D Offline
            D Offline
            Davitor
            wrote on last edited by
            #6

            Ok both are same article.But i need very simple only two line of example how can i pass Copy function in thread.Plz help me i don't need two much high funda article becouse i don't know any thing about THREAD.So plz help me

            CPalliniC A 2 Replies Last reply
            0
            • D Davitor

              Ok both are same article.But i need very simple only two line of example how can i pass Copy function in thread.Plz help me i don't need two much high funda article becouse i don't know any thing about THREAD.So plz help me

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #7

              If you really "don't know anything about threads" then it's the time either to:

              • acquire some knowledge about (and hence read that f*!?ing article!!! :mad:).

              or

              • simply abandon the idea of using threads.

              BTW option two is for the weaks, so, once again, read the article. :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              In testa che avete, signor di Ceprano?

              L 1 Reply Last reply
              0
              • D Davitor

                Ok both are same article.But i need very simple only two line of example how can i pass Copy function in thread.Plz help me i don't need two much high funda article becouse i don't know any thing about THREAD.So plz help me

                A Offline
                A Offline
                Arman S
                wrote on last edited by
                #8

                As far as I understand, you want to pass a function pointer to a thread procedure. In a simplified way it could be done like so: void MyFuncToPass(int) { //.. } UINT MyThread(PVOID param) { typedef void (*F)(int); F func = (F)param; func(10); // Call my func passed return 0; } void TheCaller() { // run the thread and pass the function to it. AfxBeginThread(MyThread, (void*)MyFuncToPass); }

                -- Arman

                1 Reply Last reply
                0
                • CPalliniC CPallini

                  If you really "don't know anything about threads" then it's the time either to:

                  • acquire some knowledge about (and hence read that f*!?ing article!!! :mad:).

                  or

                  • simply abandon the idea of using threads.

                  BTW option two is for the weaks, so, once again, read the article. :)

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #9

                  or quit programming since you lack the necessary curiosity. :rolleyes:

                  Luc Pattyn [Forum Guidelines] [My Articles]


                  - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                  CPalliniC D 2 Replies Last reply
                  0
                  • L Luc Pattyn

                    or quit programming since you lack the necessary curiosity. :rolleyes:

                    Luc Pattyn [Forum Guidelines] [My Articles]


                    - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                    CPalliniC Offline
                    CPalliniC Offline
                    CPallini
                    wrote on last edited by
                    #10

                    Good point! :)

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    In testa che avete, signor di Ceprano?

                    1 Reply Last reply
                    0
                    • L Luc Pattyn

                      or quit programming since you lack the necessary curiosity. :rolleyes:

                      Luc Pattyn [Forum Guidelines] [My Articles]


                      - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                      D Offline
                      D Offline
                      David Crow
                      wrote on last edited by
                      #11

                      Luc Pattyn wrote:

                      ...you lack the necessary curiosity.

                      Eloquently said. :thumbsup: BTW, there's a type-o on your home page.

                      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                      L 1 Reply Last reply
                      0
                      • D David Crow

                        Luc Pattyn wrote:

                        ...you lack the necessary curiosity.

                        Eloquently said. :thumbsup: BTW, there's a type-o on your home page.

                        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                        L Offline
                        L Offline
                        Luc Pattyn
                        wrote on last edited by
                        #12

                        Hi David,

                        DavidCrow wrote:

                        there's a type-o

                        there could be several, and they could well be real mistakes, can you be more specific please. I'm a bit in doubt about "client's IP address" ... :)

                        Luc Pattyn [Forum Guidelines] [My Articles]


                        - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                        D 1 Reply Last reply
                        0
                        • L Luc Pattyn

                          Hi David,

                          DavidCrow wrote:

                          there's a type-o

                          there could be several, and they could well be real mistakes, can you be more specific please. I'm a bit in doubt about "client's IP address" ... :)

                          Luc Pattyn [Forum Guidelines] [My Articles]


                          - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                          D Offline
                          D Offline
                          David Crow
                          wrote on last edited by
                          #13

                          Luc Pattyn wrote:

                          ...can you be more specific please.

                          strengthen

                          Luc Pattyn wrote:

                          I'm a bit in doubt about "client's IP address" ...

                          That's correct.

                          "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                          L 1 Reply Last reply
                          0
                          • D David Crow

                            Luc Pattyn wrote:

                            ...can you be more specific please.

                            strengthen

                            Luc Pattyn wrote:

                            I'm a bit in doubt about "client's IP address" ...

                            That's correct.

                            "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                            L Offline
                            L Offline
                            Luc Pattyn
                            wrote on last edited by
                            #14

                            Hi David,

                            DavidCrow wrote:

                            strengthen

                            Waw. Thanks for pointing that out. I had no idea, and Googling both shows both appear in similar quantities. I am struggling with th and ht quite often, e.g. height as opposed to width. is there an easy way to figure it out (apart from Google, Webster and other lookups)? :)

                            Luc Pattyn [Forum Guidelines] [My Articles]


                            - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                            modified on Wednesday, February 18, 2009 10:33 AM

                            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