Hello everyone,

The following function outputs the information in two double edged queues and using this output updates the CList control to display the required colour. It then pushes the elements in the deques one by one into two new deques and removes them from the orignal deques.

Code:
void queue_print(CPrototype3_0Dlg *mDlg)
{  
	
	while (!rowq.empty() && !colq.empty())
	{	
		mDlg->m_list.SetSubItemColor(rowq.front(), colq.front(), RGB(0,0,255),RGB(128,0,0) );
		rowbuff.push_front(rowq.front());
		colbuff.push_front(colq.front());
		rowq.pop_front();
		colq.pop_front();
	}
}
I've written the following function to empty the four queues that Im using in my application. However they do not seem to work as intended, in fact it does not seem to do anything at all.

Code:
void empty_queue()
{
while (!rowq.empty()&&!colq.empty()&&!rowbuff.empty()&&!colbuff.empty())
	{	
		rowq.pop_front();
		colq.pop_front();
		rowbuff.pop_front();
		colbuff.pop_front();
	}
}
To my understand this should remove all the elements in all the queues. I've attached both functions to a button. On the click of one button the void print queue function is accessed and the CList control is updated with satisfactory results.

Then I click the second button and the queues should all be emptied. So that when try to access the queue again it shouldn't be storing any elements. But this is not the case.

Can anyone tell me if there is any fault in the code above?

Thank You
Jaz