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. Function Address of CWinthread::Create

Function Address of CWinthread::Create

Scheduled Pinned Locked Moved C / C++ / MFC
question
10 Posts 5 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.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    would anyone know what code starts excuting when the Cwinthread::Create creates a thread ???

    C A N E 4 Replies Last reply
    0
    • F ForNow

      would anyone know what code starts excuting when the Cwinthread::Create creates a thread ???

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      There isn't a CWinThread::Create method. As about CWinThread::CreateThread method, it is defined in thrdcore.cpp (MFC sources) you may have a look at it. :)

      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]

      F 1 Reply Last reply
      0
      • F ForNow

        would anyone know what code starts excuting when the Cwinthread::Create creates a thread ???

        A Offline
        A Offline
        Akt_4_U
        wrote on last edited by
        #3

        The below link will help you. http://www.codeproject.com/KB/threads/extended\_thread.aspx

        akt

        F 2 Replies Last reply
        0
        • F ForNow

          would anyone know what code starts excuting when the Cwinthread::Create creates a thread ???

          N Offline
          N Offline
          Nishad S
          wrote on last edited by
          #4

          I would like to suggest that you should do a sample application and start debug. Then you can "step into" the code and see yourself what code is being executed.

          - ns ami -

          F 1 Reply Last reply
          0
          • F ForNow

            would anyone know what code starts excuting when the Cwinthread::Create creates a thread ???

            E Offline
            E Offline
            Eytukan
            wrote on last edited by
            #5

            I think you've been searching to pass a thread function to CWinThread? By any chance you aren't aware an AfxBeginThread(YourThreadFunc) call returns you a CWinThread?

            He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus

            F 1 Reply Last reply
            0
            • N Nishad S

              I would like to suggest that you should do a sample application and start debug. Then you can "step into" the code and see yourself what code is being executed.

              - ns ami -

              F Offline
              F Offline
              ForNow
              wrote on last edited by
              #6

              great idea.....

              1 Reply Last reply
              0
              • E Eytukan

                I think you've been searching to pass a thread function to CWinThread? By any chance you aren't aware an AfxBeginThread(YourThreadFunc) call returns you a CWinThread?

                He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus

                F Offline
                F Offline
                ForNow
                wrote on last edited by
                #7

                Yes I know but its a plain CwinThread I would like it to return My own Object Derived from CwinThread e.g. e.g. as in the MSDN example so that thread can have acess to my data members function as well as that of CWinThread // ... class CSockThread : public CWinThread { // ... Other function and member declarations protected: CSocket m_sConnected; }; SOCKET hConnected; BOOL CSockThread::InitInstance() { // Attach the socket object to the socket handle // in the context of this thread. m_sConnected.Attach(hConnected); return TRUE; } // This listening socket has been constructed // in the primary thread. void CListeningSocket::OnAccept(int nErrorCode) { // This CSocket object is used just temporarily // to accept the incoming connection. CSocket sConnected; Accept(sConnected); // Detach the newly accepted socket and save // the SOCKET handle. hConnected = sConnected.Detach(); // After detaching it, it should no longer be // used in the context of this thread. // Start the other thread. AfxBeginThread(RUNTIME_CLASS(CSockThread)); }

                1 Reply Last reply
                0
                • C CPallini

                  There isn't a CWinThread::Create method. As about CWinThread::CreateThread method, it is defined in thrdcore.cpp (MFC sources) you may have a look at it. :)

                  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]

                  F Offline
                  F Offline
                  ForNow
                  wrote on last edited by
                  #8

                  sorry still there isn't a thread start function

                  1 Reply Last reply
                  0
                  • A Akt_4_U

                    The below link will help you. http://www.codeproject.com/KB/threads/extended\_thread.aspx

                    akt

                    F Offline
                    F Offline
                    ForNow
                    wrote on last edited by
                    #9

                    Thankx this seems to be what I have been looking for a way to point to Cwinthread to my own threadproc

                    1 Reply Last reply
                    0
                    • A Akt_4_U

                      The below link will help you. http://www.codeproject.com/KB/threads/extended\_thread.aspx

                      akt

                      F Offline
                      F Offline
                      ForNow
                      wrote on last edited by
                      #10

                      in the example the derived thread CthreaEx sets m_pThreadParms which is a private member of the Base Class Cwinthread ??

                      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