Click here to Skip to main content
15,915,164 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: checkbox - remote application Pin
edvintas3-Nov-06 21:24
edvintas3-Nov-06 21:24 
QuestionMath to Message Box problem. Pin
aquawicket3-Nov-06 7:42
aquawicket3-Nov-06 7:42 
AnswerRe: Math to Message Box problem. Pin
Mark Salsbery3-Nov-06 7:47
Mark Salsbery3-Nov-06 7:47 
GeneralRe: Math to Message Box problem. Pin
aquawicket3-Nov-06 7:55
aquawicket3-Nov-06 7:55 
QuestionCFtpFileFind problems Pin
Dman83223-Nov-06 7:01
Dman83223-Nov-06 7:01 
QuestionRe: CFtpFileFind problems Pin
David Crow3-Nov-06 7:28
David Crow3-Nov-06 7:28 
AnswerRe: CFtpFileFind problems Pin
Dman83223-Nov-06 7:50
Dman83223-Nov-06 7:50 
QuestionReturn value or Exception or something else ? Pin
Mr.Brainley3-Nov-06 5:40
Mr.Brainley3-Nov-06 5:40 
This is my function :

CThreadPool::t_Job& CThreadPool::CJobQueue::getJob()
{
	WaitForSingleObject(m_JobListMutex, INFINITE);

	for ( std::deque<t_Job>::iterator it = m_JobList.begin(); it != m_JobList.end(); it++ )
		if ( it->m_JobState != JOB_WORKING)
		{
			it->m_JobState	= JOB_WORKING;
			ReleaseMutex(m_JobListMutex);
			return (*it);
		}

	ReleaseMutex(m_JobListMutex);
	//	Need to do something here to indicate no item has been found
}


I don't want to use a pointer for return. And i don't think it's apropriate to throw an exception, since that scenario is unavoidable, in fact quite regular. My only Idea left would be to return some special reference to a static element that functions as sort of a NULL. Any other ideas/comments ?
AnswerRe: Return value or Exception or something else ? Pin
Waldermort3-Nov-06 5:52
Waldermort3-Nov-06 5:52 
AnswerRe: Return value or Exception or something else ? Pin
led mike3-Nov-06 6:00
led mike3-Nov-06 6:00 
GeneralRe: Return value or Exception or something else ? Pin
Mr.Brainley3-Nov-06 6:12
Mr.Brainley3-Nov-06 6:12 
GeneralRe: Return value or Exception or something else ? Pin
Mark Salsbery3-Nov-06 6:25
Mark Salsbery3-Nov-06 6:25 
GeneralRe: Return value or Exception or something else ? Pin
Mr.Brainley3-Nov-06 6:30
Mr.Brainley3-Nov-06 6:30 
GeneralRe: Return value or Exception or something else ? Pin
Mark Salsbery3-Nov-06 6:35
Mark Salsbery3-Nov-06 6:35 
GeneralRe: Return value or Exception or something else ? Pin
Mr.Brainley3-Nov-06 6:42
Mr.Brainley3-Nov-06 6:42 
GeneralRe: Return value or Exception or something else ? Pin
Mark Salsbery3-Nov-06 6:49
Mark Salsbery3-Nov-06 6:49 
AnswerRe: Return value or Exception or something else ? Pin
Jörgen Sigvardsson3-Nov-06 6:08
Jörgen Sigvardsson3-Nov-06 6:08 
GeneralRe: Return value or Exception or something else ? Pin
Mr.Brainley3-Nov-06 6:33
Mr.Brainley3-Nov-06 6:33 
AnswerRe: Return value or Exception or something else ? Pin
Jörgen Sigvardsson3-Nov-06 6:14
Jörgen Sigvardsson3-Nov-06 6:14 
GeneralRe: Return value or Exception or something else ? Pin
Mr.Brainley3-Nov-06 6:29
Mr.Brainley3-Nov-06 6:29 
GeneralRe: Return value or Exception or something else ? Pin
Jörgen Sigvardsson3-Nov-06 6:37
Jörgen Sigvardsson3-Nov-06 6:37 
GeneralRe: Return value or Exception or something else ? Pin
Mr.Brainley3-Nov-06 6:41
Mr.Brainley3-Nov-06 6:41 
GeneralRe: Return value or Exception or something else ? Pin
Zac Howland3-Nov-06 10:52
Zac Howland3-Nov-06 10:52 
GeneralRe: Return value or Exception or something else ? Pin
Jörgen Sigvardsson3-Nov-06 11:39
Jörgen Sigvardsson3-Nov-06 11:39 
GeneralRe: Return value or Exception or something else ? Pin
Zac Howland3-Nov-06 17:11
Zac Howland3-Nov-06 17:11 

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.