Click here to Skip to main content
15,919,132 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can I assigned the child window toolbar to the pager control? Pin
ElizabethC7-Jul-03 12:16
ElizabethC7-Jul-03 12:16 
QuestionWhere is the best place to create the pager control for the application? Pin
ElizabethC3-Jul-03 7:06
ElizabethC3-Jul-03 7:06 
GeneralMultithread question Pin
achandra0073-Jul-03 6:14
achandra0073-Jul-03 6:14 
GeneralRe: Multithread question Pin
RobJones3-Jul-03 6:17
RobJones3-Jul-03 6:17 
GeneralRe: Multithread question Pin
achandra0073-Jul-03 6:33
achandra0073-Jul-03 6:33 
GeneralRe: Multithread question Pin
RobJones3-Jul-03 6:42
RobJones3-Jul-03 6:42 
GeneralRe: Multithread question Pin
John M. Drescher3-Jul-03 6:29
John M. Drescher3-Jul-03 6:29 
GeneralRe: Multithread question Pin
achandra0073-Jul-03 6:40
achandra0073-Jul-03 6:40 
John

I actually want both threads to finish, not one of them. So if I use TRUE for Parm 3 of WaitForMultipleObjects, then as soon as one thread exists, won't my statement return?

I acutally tried this:

<br />
HANDLE hEvents[2] = {NULL,NULL};<br />
CWinThread	*pThread1,*pThread2;<br />
<br />
try<br />
{	<br />
     m_bRestartMode = IsRestartMode();<br />
		<br />
     if(!m_bRestartMode)<br />
		{<br />
			//if(GetBulkDataMSARemote() == SAL2UNI_RETCODE_SUCC)<br />
			if(GetPendingANI() == SAL2UNI_RETCODE_SUCC)<br />
			{<br />
				pThread1 = AfxBeginThread(BeginWorker,(LPVOID)this);<br />
				pThread2 = AfxBeginThread(CRMWorker,(LPVOID)this);<br />
//				DoProcessing();<br />
			}<br />
		}<br />
		else<br />
		{<br />
			if(Restart())<br />
			{<br />
				pThread1 = AfxBeginThread(BeginWorker,(LPVOID)this);<br />
				pThread2 = AfxBeginThread(CRMWorker,(LPVOID)this);<br />
//				DoProcessing();<br />
			}<br />
		}<br />
<br />
		hEvents[0] = pThread1->m_hThread;<br />
		hEvents[1] = pThread2->m_hThread;<br />
			<br />
	}<br />
	catch(CDaoException *daoe)<br />
	{<br />
			CString sErrorMsg,sErrNo;<br />
			CDaoErrorInfo *errInfo = daoe->m_pErrorInfo;<br />
			<br />
			<br />
			sErrNo.Format("%d", errInfo->m_lErrorCode);<br />
			sErrorMsg = "Error No.: " + sErrNo + " - " + errInfo->m_strDescription;<br />
			sErrorMsg += " occurred in application " + errInfo->m_strSource;<br />
			LogActivity(CA_MSG_SEVERITY_INFORMATION,sErrorMsg);<br />
			daoe->Delete();<br />
	<br />
	}<br />
<br />
	WaitForMultipleObjects(2,hEvents,FALSE,INFINITE);<br />
	LogActivity(CA_MSG_SEVERITY_INFORMATION,"Both threads returned");<br />
<br />


And my code just got hung....none of the two worker threads did any work and I never got to LogActivity(...) below WaitForMultipleObjects.

Thanks
ashish
GeneralRe: Multithread question Pin
RobJones3-Jul-03 6:53
RobJones3-Jul-03 6:53 
GeneralRe: Multithread question Pin
John M. Drescher3-Jul-03 6:57
John M. Drescher3-Jul-03 6:57 
GeneralPeer to Peer network implementation in V C++ Pin
EEder3-Jul-03 5:46
EEder3-Jul-03 5:46 
GeneralRe: Peer to Peer network implementation in V C++ Pin
AlexO3-Jul-03 7:03
AlexO3-Jul-03 7:03 
GeneralRe: Peer to Peer network implementation in V C++ Pin
EEder3-Jul-03 8:14
EEder3-Jul-03 8:14 
Questionhow to change float to char* Pin
Angel Kid3-Jul-03 5:40
Angel Kid3-Jul-03 5:40 
AnswerRe: how to change float to char* Pin
AlexO3-Jul-03 5:44
AlexO3-Jul-03 5:44 
GeneralThanks Pin
Angel Kid3-Jul-03 5:58
Angel Kid3-Jul-03 5:58 
GeneralRe: how to change float to char* Pin
Ryan Binns3-Jul-03 15:39
Ryan Binns3-Jul-03 15:39 
AnswerRe: how to change float to char* Pin
Harald Krause3-Jul-03 5:48
Harald Krause3-Jul-03 5:48 
GeneralThanks Pin
Angel Kid3-Jul-03 5:59
Angel Kid3-Jul-03 5:59 
AnswerRe: how to change float to char* Pin
John M. Drescher3-Jul-03 6:04
John M. Drescher3-Jul-03 6:04 
GeneralConvert BSTR to char* Pin
RvD20023-Jul-03 5:18
sussRvD20023-Jul-03 5:18 
GeneralRe: Convert BSTR to char* Pin
Ryan Binns3-Jul-03 5:27
Ryan Binns3-Jul-03 5:27 
GeneralRe: Convert BSTR to char* Pin
RvD20023-Jul-03 6:36
sussRvD20023-Jul-03 6:36 
GeneralRe: Convert BSTR to char* Pin
Michael Dunn3-Jul-03 6:48
sitebuilderMichael Dunn3-Jul-03 6:48 
GeneralRe: Convert BSTR to char* Pin
RvD20023-Jul-03 6:52
sussRvD20023-Jul-03 6:52 

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.