[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

_beginthreadex function return value?

Posted on 1997-05-09
1
Medium Priority
?
760 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 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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .

834 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