Click here to Skip to main content
15,895,256 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ifstream in mfc cause strange errors in debug only Pin
FredrickNorge18-Jul-06 6:49
FredrickNorge18-Jul-06 6:49 
GeneralRe: ifstream in mfc cause strange errors in debug only Pin
toxcct18-Jul-06 6:56
toxcct18-Jul-06 6:56 
AnswerRe: ifstream in mfc cause strange errors in debug only Pin
Cedric Moonen18-Jul-06 7:03
Cedric Moonen18-Jul-06 7:03 
GeneralRe: ifstream in mfc cause strange errors in debug only [modified] Pin
FredrickNorge18-Jul-06 7:16
FredrickNorge18-Jul-06 7:16 
GeneralRe: ifstream in mfc cause strange errors in debug only Pin
Cedric Moonen18-Jul-06 7:25
Cedric Moonen18-Jul-06 7:25 
GeneralRe: ifstream in mfc cause strange errors in debug only Pin
FredrickNorge18-Jul-06 7:27
FredrickNorge18-Jul-06 7:27 
QuestionRe: ifstream in mfc cause strange errors in debug only Pin
David Crow18-Jul-06 8:33
David Crow18-Jul-06 8:33 
AnswerRe: ifstream in mfc cause strange errors in debug only [modified] Pin
Maxwell Chen18-Jul-06 7:58
Maxwell Chen18-Jul-06 7:58 
FredrickNorge wrote:
vs2005, when i want to debug my mfc app with #include fstream


FredrickNorge wrote:
1>C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\xdebug(32)


Generally speaking, in a MFC/VS2005 project of Debug configuration, the version of operator new being invoked is:

"afxmem.cpp" line 59,
void* __cdecl operator new(size_t nSize, LPCSTR lpszFileName, int nLine)
{
	return ::operator new(nSize, _NORMAL_BLOCK, lpszFileName, nLine);
}


And then "afxmem.cpp" line 393,
void* __cdecl operator new(size_t nSize, int nType, LPCSTR lpszFileName, int nLine)
{
#ifdef _AFX_NO_DEBUG_CRT
	UNUSED_ALWAYS(nType);
	UNUSED_ALWAYS(lpszFileName);
	UNUSED_ALWAYS(nLine);
	return ::operator new(nSize);
#else
	void* pResult;
#ifdef _AFXDLL
	_PNH pfnNewHandler = _pfnUninitialized;
#endif
	for (;;)
	{
		pResult = _malloc_dbg(nSize, nType, lpszFileName, nLine);
		if (pResult != NULL)
			return pResult;

#ifdef _AFXDLL
		if (pfnNewHandler == _pfnUninitialized)
		{
			AFX_MODULE_THREAD_STATE* pState = AfxGetModuleThreadState();
			pfnNewHandler = pState->m_pfnNewHandler;
		}
		if (pfnNewHandler == NULL || (*pfnNewHandler)(nSize) == 0)
			break;
#else
		if (_afxNewHandler == NULL || (*_afxNewHandler)(nSize) == 0)
			break;
#endif
	}
	return pResult;
#endif
}




Maxwell Chen

-- modified at 14:01 Tuesday 18th July, 2006
GeneralRe: ifstream in mfc cause strange errors in debug only Pin
FredrickNorge18-Jul-06 8:14
FredrickNorge18-Jul-06 8:14 
GeneralRe: ifstream in mfc cause strange errors in debug only Pin
Maxwell Chen18-Jul-06 8:25
Maxwell Chen18-Jul-06 8:25 
GeneralRe: ifstream in mfc cause strange errors in debug only Pin
FredrickNorge18-Jul-06 8:37
FredrickNorge18-Jul-06 8:37 
Questionmoving existing C++ code to .NET Pin
agurnani18-Jul-06 6:14
agurnani18-Jul-06 6:14 
AnswerRe: moving existing C++ code to .NET Pin
NrmMyth18-Jul-06 8:41
NrmMyth18-Jul-06 8:41 
QuestionNeed help solving a couple of problems with the CFileDialog Pin
Z.K.18-Jul-06 5:48
Z.K.18-Jul-06 5:48 
AnswerRe: Need help solving a couple of problems with the CFileDialog Pin
David Crow18-Jul-06 6:20
David Crow18-Jul-06 6:20 
Questionforcing repaint after CDC::TextOut function Pin
goodoljosh198018-Jul-06 4:57
goodoljosh198018-Jul-06 4:57 
AnswerRe: forcing repaint after CDC::TextOut function Pin
Chris Losinger18-Jul-06 5:01
professionalChris Losinger18-Jul-06 5:01 
AnswerRe: forcing repaint after CDC::TextOut function Pin
Maximilien18-Jul-06 5:06
Maximilien18-Jul-06 5:06 
GeneralRe: forcing repaint after CDC::TextOut function Pin
goodoljosh198018-Jul-06 5:10
goodoljosh198018-Jul-06 5:10 
GeneralRe: forcing repaint after CDC::TextOut function Pin
Steve S18-Jul-06 5:14
Steve S18-Jul-06 5:14 
GeneralRe: forcing repaint after CDC::TextOut function Pin
goodoljosh198018-Jul-06 5:18
goodoljosh198018-Jul-06 5:18 
GeneralRe: forcing repaint after CDC::TextOut function Pin
Hamid_RT18-Jul-06 5:21
Hamid_RT18-Jul-06 5:21 
GeneralRe: forcing repaint after CDC::TextOut function Pin
goodoljosh198018-Jul-06 5:25
goodoljosh198018-Jul-06 5:25 
AnswerRe: forcing repaint after CDC::TextOut function Pin
Ravi Bhavnani18-Jul-06 7:29
professionalRavi Bhavnani18-Jul-06 7:29 
GeneralRe: forcing repaint after CDC::TextOut function Pin
Hamid_RT18-Jul-06 18:40
Hamid_RT18-Jul-06 18:40 

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.