Click here to Skip to main content
15,885,278 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Self-registered edit control class crashes because of wrong GetWindowTextLength return value Pin
Skarrin5-Mar-08 21:28
Skarrin5-Mar-08 21:28 
GeneralRe: Self-registered edit control class crashes because of wrong GetWindowTextLength return value Pin
Randor 5-Mar-08 8:56
professional Randor 5-Mar-08 8:56 
GeneralRe: Self-registered edit control class crashes because of wrong GetWindowTextLength return value Pin
Skarrin5-Mar-08 21:52
Skarrin5-Mar-08 21:52 
QuestionHow to display animated gif on status bar Pin
ptr_Electron5-Mar-08 4:56
ptr_Electron5-Mar-08 4:56 
AnswerRe: How to display animated gif on status bar Pin
toxcct5-Mar-08 5:04
toxcct5-Mar-08 5:04 
GeneralRe: How to display animated gif on status bar Pin
ptr_Electron6-Mar-08 0:41
ptr_Electron6-Mar-08 0:41 
AnswerRe: How to display animated gif on status bar Pin
Mark Salsbery5-Mar-08 14:31
Mark Salsbery5-Mar-08 14:31 
GeneralGetting Thread Exit Code Pin
masnu5-Mar-08 4:23
masnu5-Mar-08 4:23 
I have created a worker thread to connect to a data server. The thread needs to wait a few seconds and exit if no data arrives (i.e. server is not online). I need to trap the thread exit code so my main thread can know if the workher thread terminated with an error. I have the following code:

<br />
static UINT Connect(void* p_this);<br />
UINT  Connect();<br />
<br />
<br />
UINT Client::Connect(void* p_this)<br />
{<br />
<br />
Client* pClient = (Client*)p_this;<br />
pClient->Connect();<br />
<br />
}<br />
<br />
UINT Client::Connect()<br />
{<br />
<br />
CDataServer pServer = new CDataServer();<br />
<br />
........<br />
<br />
int nError = pServer->Connect();<br />
<br />
if ( nError !=  0 ) //Error connecting to server<br />
return nError;<br />
<br />
.......<br />
<br />
}<br />


From the documentation I know I can use GetExitCodeThread to get the error code but where is the best place to put this? Should I post an exit message to the main thread and read the code there? Are there any other solutions that would be better?

Thanks.
GeneralRe: Getting Thread Exit Code Pin
led mike5-Mar-08 4:30
led mike5-Mar-08 4:30 
GeneralRe: Getting Thread Exit Code Pin
masnu5-Mar-08 4:33
masnu5-Mar-08 4:33 
GeneralRe: Getting Thread Exit Code Pin
Ernest Laurentin5-Mar-08 4:41
Ernest Laurentin5-Mar-08 4:41 
GeneralRe: Getting Thread Exit Code Pin
CPallini5-Mar-08 4:48
mveCPallini5-Mar-08 4:48 
GeneralRe: Getting Thread Exit Code Pin
led mike5-Mar-08 5:29
led mike5-Mar-08 5:29 
GeneralRe: Getting Thread Exit Code Pin
Mark Salsbery5-Mar-08 14:32
Mark Salsbery5-Mar-08 14:32 
Questionhow to watch the content which is pointed by a pointer Pin
wendyyue5-Mar-08 3:50
wendyyue5-Mar-08 3:50 
AnswerRe: how to watch the content which is pointed by a pointer Pin
toxcct5-Mar-08 4:15
toxcct5-Mar-08 4:15 
GeneralRe: how to watch the content which is pointed by a pointer Pin
Rajkumar R5-Mar-08 4:59
Rajkumar R5-Mar-08 4:59 
GeneralRe: how to watch the content which is pointed by a pointer Pin
toxcct5-Mar-08 5:01
toxcct5-Mar-08 5:01 
GeneralRe: how to watch the content which is pointed by a pointer Pin
Rajkumar R5-Mar-08 5:12
Rajkumar R5-Mar-08 5:12 
AnswerRe: how to watch the content which is pointed by a pointer Pin
Ernest Laurentin5-Mar-08 4:44
Ernest Laurentin5-Mar-08 4:44 
GeneralRe: how to watch the content which is pointed by a pointer Pin
wendyyue6-Mar-08 1:27
wendyyue6-Mar-08 1:27 
QuestionVC++ 6.0 question newbie question Pin
johnny alpaca5-Mar-08 2:54
johnny alpaca5-Mar-08 2:54 
AnswerRe: VC++ 6.0 question newbie question Pin
Rajkumar R5-Mar-08 3:14
Rajkumar R5-Mar-08 3:14 
GeneralRe: VC++ 6.0 question newbie question Pin
johnny alpaca5-Mar-08 3:18
johnny alpaca5-Mar-08 3:18 
QuestionRe: VC++ 6.0 question newbie question Pin
Rajkumar R5-Mar-08 3:19
Rajkumar R5-Mar-08 3:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.