Solved

_beginthreadex function return value?

Posted on 1997-05-09
1
651 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
1 Comment
 
LVL 4

Accepted Solution

by:
emmons earned 100 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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…

776 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