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. _Begin Thread c++Query

_Begin Thread c++Query

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++databasedata-structureshelp
3 Posts 3 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.
  • K Offline
    K Offline
    Killer3
    wrote on last edited by
    #1

    _beginthread(void( __cdecl *start_address )( void * ),unsigned stack_size, void *arglist ); void * arglist ==> can this point to a list of arguments. Since the thread function can have only one parameter of void * how can i achieve the requirement is to pass set of initialisation to the thread function. Any body help me ? for thendral

    N T 2 Replies Last reply
    0
    • K Killer3

      _beginthread(void( __cdecl *start_address )( void * ),unsigned stack_size, void *arglist ); void * arglist ==> can this point to a list of arguments. Since the thread function can have only one parameter of void * how can i achieve the requirement is to pass set of initialisation to the thread function. Any body help me ? for thendral

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      better u create a structure will all the set of variables u want to pass to thread. Now pass the pointer of this structure to the thread. In the thread function, u can again convert the void* pointer to a pointer of your structure and use all the member inside it. nave

      1 Reply Last reply
      0
      • K Killer3

        _beginthread(void( __cdecl *start_address )( void * ),unsigned stack_size, void *arglist ); void * arglist ==> can this point to a list of arguments. Since the thread function can have only one parameter of void * how can i achieve the requirement is to pass set of initialisation to the thread function. Any body help me ? for thendral

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        R.ilan thendral wrote:

        how can i achieve the requirement is to pass set of initialisation to the thread function.

        Cast any class or structure to void and recast it back from thread!

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

        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