Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8045089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:26:09+00:00 2026-06-05T05:26:09+00:00

This is my first time dealing with windows. I tried to create thread, but

  • 0

This is my first time dealing with windows. I tried to create thread, but I can’t compile my code.

This is a part of my code:

WORD _tid;
HANDLE  readerThread= CreateThread(0,0,readFromPort,0,0,&_tid); 
DWORD WINAPI readFromPort(LPVOID lpParam ){}

I also tried :

LPDWORD_tid;
HANDLE  readerThread= CreateThread(0,0,readFromPort,0,0,_tid); 
DWORD WINAPI readFromPort(LPVOID lpParam ){}

Neither compiled. onyone knows what is the problem?

(I’m using windows xp)

thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:26:10+00:00Added an answer on June 5, 2026 at 5:26 am

    well, don’t know what’s error you have. But can provide a good example to you

    #include "windows.h"
    DWORD WINAPI readFromPort(LPVOID lpParam ){return 0;}
    int _tmain(int argc, _TCHAR* argv[])
    {
        DWORD _tid;
        HANDLE  readerThread= CreateThread(0,0,readFromPort,0,0,&_tid); 
        return 0;
    }
    

    difference to yours:

    1. _tid is DWORD, not WORD.

    2. the readFromPort returns value 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This was the first time I encountered this kind of error after dealing with
The first time this loop iterates works well but after I press the char
First off, I am sorry if this is a duplicate, but every time I
First time with this trouble when dealing with a MySQL table. I'm inserting bar
I'm working with Doctrine2 for the first time, but I think this question is
This is my first time comparing dates in Objective-C. I've been searching the web
this is my first time playing with recursive functions, and this function that I
This is my first time posting to Stack Overflow. I'm trying to build a
this is my first time trying to use java for backend web systems. I
this is my first time in using recaptcha on my website. I'm using PHP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.