What do I need and how can I use threads in C on Windows Vista?
Could you please give me a simple code example?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is the MSDN sample on how to use CreateThread() on Windows.
The basic idea is you call CreateThread() and pass it a pointer to your thread function, which is what will be run on the target thread once it is created.
The simplest code to do it is:
You also have the option of calling SHCreateThread()—same basic idea but will do some shell-type initialization for you if you ask it, such as initializing COM, etc.