Drowzee 3 Posting Whiz in Training

I'm almost done with my project, due in great part to the support and well-reasoned criticism here at Daniweb.

But there's one last little problem that's only hitting me in release mode.

In debug, the following function works fine to set information from a user-entered string to the CString/CString Map. But in release, it doesn't seem to store the text in the user_set array. Any ideas on why this would be?

This is from a CEdit control in a dialog.

void CRenameDialog::OnMapSet() 
{
	if(allow_write)
	{
		char user_set[5];			//The new name set by the user.	
		c_mapEdit.GetLine(0,user_set);
		MessageBox(user_set,NULL,MB_OK);
		CString setStr=user_set;
		
		//Selection must be Valid, otherwise couldn't be inside this area.
		m_mapIter->second = setStr;
		MessageBox(m_mapIter->second,NULL,MB_OK);
		c_mapList.InsertString(c_mapList.GetCurSel(),setStr);
		c_mapList.DeleteString(c_mapList.GetCurSel());		
		allow_write = 0;
	}	
	return;
}

Thanks in advance.

EDIT:
I changed the 'GetLine' to 'GetWindowText', and everything works now.

void CRenameDialog::OnMapSet() 
{
	if(allow_write)
	{		
		CString setStr;//=user_set;
		c_mapEdit.GetWindowText(setStr);
		
		
		//Selection must be Valid, otherwise couldn't be inside this area.
		m_mapIter->second = setStr;		
		c_mapList.InsertString(c_mapList.GetCurSel(),setStr);
		c_mapList.DeleteString(c_mapList.GetCurSel());		
		allow_write = 0;
	}	
	return;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.