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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:32:11+00:00 2026-06-13T00:32:11+00:00

copying some data I had for working boost threads, I implemented the following code

  • 0

copying some data I had for working boost threads, I implemented the following code below.
I get the error C:\dev\default threads_threads.cpp|18|error: invalid conversion from ‘void ()(void)’ to ‘unsigned int (attribute((stdcall)) )(void)’ [-fpermissive]|

but… the commented lines are what was recommended, and a comment explains the error I got.

it turns out _beginThreadEx is highly recommended, but poorly documented (as in tutorials) on the web

#include <iostream>
#include <process.h>

void myThread(void *data)
{
    //C:\dev\default threads\_threads.cpp|6|error: invalid conversion from 'int*' to 'int' [-fpermissive]|
    //int x = static_cast<int*>(data);

    int *x = (int*)data;

    std::cout << "Hellow World! " << x;
}

int main()
{

    int x = 10;
    _beginthreadex(NULL, 0, myThread, &x, 0, NULL);
    while(true);
}
  • 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-13T00:32:12+00:00Added an answer on June 13, 2026 at 12:32 am

    You have to declare x as pointer anyway:

    int *x = static_cast<int*>(data);
    

    both _beginthread and _beginthreadex are documented here: http://msdn.microsoft.com/en-us/library/kdzttdcb(v=vs.80).aspx

    According to the declaration of _beginthreadex() your myThread() function should be declared like this:

    unsigned __stdcall myThread(void *data);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm copying a subset of some data, so that the copy will be independently
I have some data that is both read and updated by multiple threads. Both
I am copying some user data from one SqlServer to another. Call them Alpha
I have this code in a library: class Parent { //some data and functions
I am copying some data from sql server to firebird over the network. Because
I'm using Boost.Range to pass around some data and a container class for this
I'm working with a function which yields some data as a std::vector<char> and another
I am working on an app that needs to pull some data that is
Copying Zenf Framework everywhere is a nightmare, so I had an idea, thas deployment
I am copying code from website matplotlib and pasting into the Vim editor in

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.