CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: CreateThread

  1. #1
    Join Date
    Jul 2010
    Posts
    94

    Thumbs up CreateThread

    Hello

    I have some buttons on my Dialog, and for each of them I will do some jobs,
    I'd like to createthread for each call (each time I press a button)

    But this, I have no idea of what I am doing , that is, Is this CreateThread used for each button necessary and for what advantages ? clearly I don't need to call it but still can make the program work (Pssss because my problem is simple )

    So I am looking forward to your replies

    I am not in a hurry because this program will finish in 2012, to be sure

    Thank you

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: CreateThread

    If your project is an MFC one - use AfxBeginThread instead of CreateThread API.
    If it is a Win32 application - use _beginthreadex C-runtime function to start a thread.
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2010
    Posts
    94

    Re: CreateThread

    Thanks buddy VictorN
    But why and for what advantages should I do so ?

  4. #4
    Join Date
    Dec 2009
    Posts
    145

    Re: CreateThread

    VictorN means how to create a worker thread. http://www.google.com/search?q=what+...ient=firefox-a

    When multiple createthreads are used, you will need a message queue implemented to process each thread's messages, which complicates your problem. Normal IPC approach definitely is the way to go in your case...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured