Click here to Skip to main content
16,011,447 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to terminate the secondary thread when the application closed? Pin
susanne126-Aug-09 0:57
susanne126-Aug-09 0:57 
AnswerRe: How to terminate the secondary thread when the application closed? Pin
Rajesh R Subramanian26-Aug-09 1:36
professionalRajesh R Subramanian26-Aug-09 1:36 
GeneralRe: How to terminate the secondary thread when the application closed? Pin
susanne126-Aug-09 1:41
susanne126-Aug-09 1:41 
AnswerRe: How to terminate the secondary thread when the application closed? Pin
Rajesh R Subramanian26-Aug-09 1:57
professionalRajesh R Subramanian26-Aug-09 1:57 
GeneralRe: How to terminate the secondary thread when the application closed? Pin
Stuart Dootson26-Aug-09 3:38
professionalStuart Dootson26-Aug-09 3:38 
GeneralRe: How to terminate the secondary thread when the application closed? Pin
Rajesh R Subramanian26-Aug-09 5:05
professionalRajesh R Subramanian26-Aug-09 5:05 
AnswerRe: How to terminate the secondary thread when the application closed? Pin
David Crow26-Aug-09 2:51
David Crow26-Aug-09 2:51 
QuestionAfter SuspendThread Messagebox not working. Pin
Le@rner26-Aug-09 0:13
Le@rner26-Aug-09 0:13 
Hi all,

i m using SuspendThread to suspend the thread after this the next statement to be executed is Message box for confirmation of termination of thread,but when this line execute the control not display after this and window becomes unresponsive,i mean message box not return any value.

CWinThread* load_file;
//Start thread at desired location
load_file=AfxBeginThread(Load_ThreadProc,NULL,THREAD_PRIORITY_HIGHEST,0,0,NULL);


void CLoad_Modeless::OnBnClickedStopBtn()
{
	if(load_file!=NULL)
	{
		::SuspendThread(load_file->m_hThread);
			
		if(AfxMessageBox(("Do you really want to stop process?"),MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2) == IDYES)//after this control not displayed
		{	
			::TerminateThread(load_file->m_hThread,0);
			load_file=NULL;

		}
		else
			::ResumeThread(load_file->m_hThread);
	}
}


please help me for this

thanks in advance.

To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.

AnswerRe: After SuspendThread Messagebox not working. Pin
Stephen Hewitt26-Aug-09 0:21
Stephen Hewitt26-Aug-09 0:21 
AnswerRe: After SuspendThread Messagebox not working. Pin
Cedric Moonen26-Aug-09 0:22
Cedric Moonen26-Aug-09 0:22 
AnswerRe: After SuspendThread Messagebox not working. Pin
Rajesh R Subramanian26-Aug-09 0:27
professionalRajesh R Subramanian26-Aug-09 0:27 
QuestionTCP/IP Message Framing and Parsing [modified] Pin
staticv26-Aug-09 0:13
staticv26-Aug-09 0:13 
AnswerRe: TCP/IP Message Framing and Parsing Pin
Stuart Dootson26-Aug-09 3:43
professionalStuart Dootson26-Aug-09 3:43 
GeneralRe: TCP/IP Message Framing and Parsing Pin
staticv26-Aug-09 17:16
staticv26-Aug-09 17:16 
GeneralRe: TCP/IP Message Framing and Parsing Pin
Stuart Dootson26-Aug-09 21:20
professionalStuart Dootson26-Aug-09 21:20 
GeneralRe: TCP/IP Message Framing and Parsing Pin
Moak26-Aug-09 21:22
Moak26-Aug-09 21:22 
GeneralRe: TCP/IP Message Framing and Parsing Pin
staticv26-Aug-09 21:40
staticv26-Aug-09 21:40 
QuestionNo Word Wrap at CR or LF or CRLF Pin
thomasIC26-Aug-09 0:04
thomasIC26-Aug-09 0:04 
AnswerRe: No Word Wrap at CR or LF or CRLF Pin
«_Superman_»26-Aug-09 0:51
professional«_Superman_»26-Aug-09 0:51 
GeneralRe: No Word Wrap at CR or LF or CRLF Pin
thomasIC26-Aug-09 1:08
thomasIC26-Aug-09 1:08 
GeneralRe: No Word Wrap at CR or LF or CRLF Pin
«_Superman_»26-Aug-09 2:03
professional«_Superman_»26-Aug-09 2:03 
GeneralRe: No Word Wrap at CR or LF or CRLF Pin
thomasIC26-Aug-09 2:30
thomasIC26-Aug-09 2:30 
GeneralRe: No Word Wrap at CR or LF or CRLF Pin
David Crow26-Aug-09 3:00
David Crow26-Aug-09 3:00 
GeneralRe: No Word Wrap at CR or LF or CRLF Pin
thomasIC26-Aug-09 3:14
thomasIC26-Aug-09 3:14 
QuestionRe: No Word Wrap at CR or LF or CRLF Pin
David Crow26-Aug-09 3:18
David Crow26-Aug-09 3:18 

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.