?
Solved

_beginthreadex function return value?

Posted on 1997-05-09
1
Medium Priority
?
716 Views
Last Modified: 2013-12-04
The _beginthreadex function takes as the third parameter
(the thread start location) a function which returns an unsigned int.  My question is, where/when do you get access
to that return value?  At the point where the thread is
finished, the thread which started the auxilliary thread
will be long past the point where the stack could be used
to examine the value that the thread function returned.
0
Comment
Question by:flash103
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
emmons earned 200 total points
ID: 1397235
After the thread finishes, you can still call GetExitCodeThread to find out what the value was that was returned.
BOOL GetExitCodeThread( HANDLE hThread, LPDWORD lpdwExitCode)

The exit code is returned in the DWORD. If the thread has not yet termineated, the DWORD contains STILL_ACTIVE (0x103). If it is successful, it returns TRUE.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question