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 878683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:48:21+00:00 2026-05-15T11:48:21+00:00

HANDLE hThread; DWORD dwThreadId; hThread = CreateThread( NULL, // default security attributes 0, //

  • 0
     HANDLE  hThread;
     DWORD   dwThreadId;

         hThread = CreateThread( 
     NULL,                   // default security attributes
     0,                      // use default stack size  
     MyThreadFunction,       // thread function name
     0,                      // argument to thread function 
     0,                      // use default creation flags 
     &dwThreadId);           // returns the thread identifier  <--Debugger takes me to this line?

The error specifies the 3rd parameter but when i double click on the error it takes me to the last parameter?
Trying to run the msdn CreateThread example http://msdn.microsoft.com/en-us/library/ms682453%28VS.85%29.aspx

error C2664: 'CreateThread' : cannot convert parameter 3 from 'void (void)' to 'unsigned long (__stdcall *)(void *)'
        None of the functions with this name in scope match the target type
  • 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-05-15T11:48:21+00:00Added an answer on May 15, 2026 at 11:48 am

    Clicking on the error takes you to the last parameter because the go-to-error function can only go by statements, and the entire function call is one statement.

    Basically, your problem is that MyThreadFunction has the wrong signature. It should be unsigned long __stdcall MyThreadFunction(void*) (or the equivalent thereof), but you wrote void MyThreadFunction(void) (or the equivalent thereof).

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

Sidebar

Related Questions

I saw the following code on the internet as DWORD qThreadID; HANDLE hThread =
I am trying to handle a case of a DateTime which might be null
Basically, I'm looking to do something like this: HANDLE hThread1 = CreateThread(...); HANDLE hThread2
#include <iostream> #include <Windows.h> #include <process.h> //#include windowstate.cpp //DWORD WINAPI MyThreadFunction( LPVOID lpParam );
Is it possible for stack space allocated by CreateThread to interfere with the usage
To handle an event, I use the code as below: obj.Evt += new EvtEventHandler(DoEvt);
How do I create a thread routine of a static member function class Blah
HANDLE Proc; HMODULE hDLL; hDLL = LoadLibrary(TEXT(mscoree.dll)); if(hDLL == NULL) cout << No Dll
In one of my class i'm launching a thread using the following method: HANDLE
I have an SQLite database in Android and I use a ContentProvider to handle

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.