Questions tagged [beginthreadex]

28 questions
0
votes
1 answer

Can't compile a C++ program with _beginthreadex

#include #include #include //#include "windowstate.cpp" //DWORD WINAPI MyThreadFunction( LPVOID lpParam ); using namespace std; int Zeit; unsigned int __stdcall wfshutdown() { Sleep(Zeit*60000); …
AaronP
  • 43
  • 1
  • 4
0
votes
0 answers

Problem with unresolved external symbol of a variable in a class with _beginthread

I'm not sure why a static declared variable is not being recognized in my C++ class. I am using _beginthreadex(), so from what I found, it seems I need the class function containing _beginthreadex() to be declared as static. Here is a working…
JeffR
  • 765
  • 2
  • 8
  • 23
0
votes
0 answers

How to minimize cpu usage in a thread created by _beginThreadEx?

I have a Windows app that simply runs in the background and watches constantly for data appearing on stdin by means of a separate thread. It does this because it is a Chrome native messaging host and that's how it is expected to communicate with…
0
votes
1 answer

How to send a string to _beginthreadex for the thread to read it?

I want to use _beginthreadex and pass a character string, the name of a domain. What is the proper way/best practice to pass it? By variable itself (sDomain)? WCHAR sDomain[256] = {0}; //...copy domain into sDomain UINT threadID = 0; …
JeffR
  • 765
  • 2
  • 8
  • 23
0
votes
1 answer

C++ Win32 Threads

I have some problems with using _beginthreadex. How can I send function that was made by me to a thread? I am totally new to threads, its so silly question, but I can't handle it //Function that I want to send to a thread vectorF1(vector
0
votes
1 answer

Boost 1.58.0 windows process.h error

I am trying to port my application to use boost 1.58.0 from 1.53.0 Getting this error while compiling in windows \include\boost/interprocess/detail/os_thread_functions.hpp(495): error C3861: '_beginthreadex': identifier not…
0
votes
1 answer

issue with _beginthreadex used with MFC class

Can't use _beginthreadex in MFC giving error as error C3861: '_beginthreadex': identifier not found beginthreadex working fine without MFC code. Edit:Issue was with file inclusion sequence and need was to use _beginthreadex //…
0
votes
2 answers

Passing an Object and getting the return value from a thread call

I want to pass a class object into a method of other class through a thread call, I tried but got the error can any one help me on this.please. struct sample{ int status; std::vector a_row; size_t column_count; std::vector…
vamsi krishna
  • 31
  • 1
  • 8
0
votes
0 answers

thread(_beginthreadex) winsock(accept)

i wanna make a winsock non blocking object this is my code main function: #include #include #include "server.h" #include using namespace std; int main() { Object_server a; Sleep(100000); return…
Ken
  • 13
  • 1
  • 4
0
votes
1 answer

unhandled read exception in thread after passing class into thread

http://pastebin.com/QPab6nkp is all my code, pretty messy and unfinished. I found where is an error - i think im passing philosophist exemplar into thread incorectly, because into the thread, philosophist *ph = static_cast(params); -…
0
votes
1 answer

Why aren't my threads running?

// windows_procon.cpp : Defines the entry point for the console application. #include "stdafx.h" #include #include #include #include #include using namespace std; HANDLE mutex; HANDLE…
user2134127
  • 135
  • 1
  • 2
  • 9
0
votes
0 answers

Passing struct to _beginThreadEx() function produces unintended output

I'm trying to learn the "proper" way of passing multiple parameters to a _beginThreadEx function. Could use some help. In function myThread. I keep getting either a 1, or 3, or 5 appended to the output of *x->value Also... if I place cout << "die:…
thistleknot
  • 1,098
  • 16
  • 38
-1
votes
1 answer

Why is beginthreadex thread argument variable not updating in parent thread

I have a thread which creates a hidden window for the purpose of receiving WinAPI messages based on power state. I need to get the HWND of the created window from the thread so that I can throw a WM_QUIT message to close the window and end the…
Connor Spangler
  • 805
  • 2
  • 12
  • 29
1
2