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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Worker Thread Question!

Worker Thread Question!

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 4 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.
  • P Offline
    P Offline
    peter ho
    wrote on last edited by
    #1

    I tried to create a worker thread. However, I keep get the compile error "error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (__cdecl *)(void)'" Please help! many thanks! p. //I have a global Thread function: UINT connection(LPVOID pParam) { ... return 1; } //Start the worker thread AfxBeginThread(connection) { .... }

    J D V 3 Replies Last reply
    0
    • P peter ho

      I tried to create a worker thread. However, I keep get the compile error "error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (__cdecl *)(void)'" Please help! many thanks! p. //I have a global Thread function: UINT connection(LPVOID pParam) { ... return 1; } //Start the worker thread AfxBeginThread(connection) { .... }

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      try AfxBeginThread ( connection , NULL ) ; the second param is a user data if u dont need it u can pass NULL Papa while (TRUE) Papa.WillLove ( Bebe ) ;

      1 Reply Last reply
      0
      • P peter ho

        I tried to create a worker thread. However, I keep get the compile error "error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (__cdecl *)(void)'" Please help! many thanks! p. //I have a global Thread function: UINT connection(LPVOID pParam) { ... return 1; } //Start the worker thread AfxBeginThread(connection) { .... }

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

        What's the rest of the error? It will tell you what the compiler is expecting. You can also put the cursor on AfxBeginThread() and hit F12. This will take you to the function's prototype.

        1 Reply Last reply
        0
        • P peter ho

          I tried to create a worker thread. However, I keep get the compile error "error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (__cdecl *)(void)'" Please help! many thanks! p. //I have a global Thread function: UINT connection(LPVOID pParam) { ... return 1; } //Start the worker thread AfxBeginThread(connection) { .... }

          V Offline
          V Offline
          valikac
          wrote on last edited by
          #4

          Weird. Do you have connection() declared in the interface (*.h) file? AfxBeginThread() takes in as parameters more than one or even two. Kuphryn

          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