Click here to Skip to main content
15,887,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get an Application Instance Number? Pin
Software200723-Apr-10 8:43
Software200723-Apr-10 8:43 
AnswerRe: How to get an Application Instance Number? Pin
mesajflaviu23-Apr-10 8:45
mesajflaviu23-Apr-10 8:45 
QuestionRe: How to get an Application Instance Number? Pin
Maximilien23-Apr-10 9:07
Maximilien23-Apr-10 9:07 
GeneralRe: How to get an Application Instance Number? Pin
Software200723-Apr-10 9:10
Software200723-Apr-10 9:10 
AnswerRe: How to get an Application Instance Number? Pin
Maximilien23-Apr-10 9:16
Maximilien23-Apr-10 9:16 
GeneralRe: How to get an Application Instance Number? Pin
Software200723-Apr-10 9:35
Software200723-Apr-10 9:35 
AnswerRe: How to get an Application Instance Number? Pin
LloydA11123-Apr-10 15:09
LloydA11123-Apr-10 15:09 
QuestionHeap Error Pin
ashwath197923-Apr-10 2:23
ashwath197923-Apr-10 2:23 
Hi All,

I am running an application which is a form view application.I am allocating memory of size 160kb in a for loop .I am allocating memory at the begining of for loop for each iteration and freeing it at the end of each iteration.I have 133 such iteration.But i am facing a problem.In the 9th iteration when i am trying to allocate a memory using malloc the application crashes.

I am getting the following messsage in the output window.

HEAP[TEST.exe]: HEAP: Free Heap block 3f277a8 modified at 3f27850 after it was freed


I am getting the following messages in the call stack window:

ntdll.dll!7c90120e() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]	
 	ntdll.dll!7c96e139() 	
 	ntdll.dll!7c94b535() 	
 	ntdll.dll!7c927573() 	
 	ntdll.dll!7c91005d() 	
 	ntdll.dll!7c927784() 	
 	ntdll.dll!7c927573() 	
>	TEST.exe!_heap_alloc_base(unsigned int size=160036)  Line 105 + 0x28 bytes	C
 	TEST.exe!_heap_alloc_dbg_impl(unsigned int nSize=160000, int nBlockUse=1, const char * szFileName=0x00000000, int nLine=0, int * errno_tmp=0x015cf02c)  Line 427 + 0x9 bytes	C++
 	TEST.exe!_nh_malloc_dbg_impl(unsigned int nSize=160000, int nhFlag=0, int nBlockUse=1, const char * szFileName=0x00000000, int nLine=0, int * errno_tmp=0x015cf02c)  Line 239 + 0x19 bytes	C++
 	TEST.exe!_nh_malloc_dbg(unsigned int nSize=160000, int nhFlag=0, int nBlockUse=1, const char * szFileName=0x00000000, int nLine=0)  Line 296 + 0x1d bytes	C++
 	TEST.exe!malloc(unsigned int nSize=160000)  Line 56 + 0x15 bytes	C++
 	TEST.exe!TEST_IDP_FUNC1(unsigned char * pucSrcImg=0x07200068, unsigned char * pucDstImg=0x059d4d68, unsigned short uiSrcRows=400, unsigned short uiSrcCols=400, TBoundBox * pstBoundBox=0x05bd8318)  Line 529 + 0x11 bytes	C
 	TEST.exe!TEST_IDP_FUNC2(unsigned char * pucSrcImg=0x05aecc58, unsigned char * pucDstImg=0x03f00690, unsigned short uiSrcRows=400, unsigned short uiSrcCols=400, unsigned short uiDstRows=400, unsigned short uiDstCols=400, TBoundBox * pstBoundBox=0x05bd8318)  Line 4117 + 0x1b bytes	C
 	TEST.exe!CTEST::FUNC3(CTESTImage * objSrcImage=0x03e726c8, CTESTImage * objDstnImage=0x03e7a050, unsigned char * pucDstImg=0x03f00690)  Line 107 + 0x25 bytes	C++
 	TEST.exe!CTESTView::FUNC4()  Line 8346	C++
 	TEST.exe!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x0039c900, unsigned int nID=32902, int nCode=0, void (void)* pfn=0x00401276, void * pExtra=0x00000000, unsigned int nSig=57, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)  Line 82	C++
 	TEST.exe!CCmdTarget::OnCmdMsg(unsigned int nID=32902, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)  Line 381 + 0x27 bytes	C++
 	TEST.exe!CView::OnCmdMsg(unsigned int nID=32902, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)  Line 162 + 0x18 bytes	C++
 	TEST.exe!CFrameWnd::OnCmdMsg(unsigned int nID=32902, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)  Line 942 + 0x23 bytes	C++
 	TEST.exe!CFrameWndEx::OnCmdMsg(unsigned int nID=32902, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)  Line 995 + 0x18 bytes	C++
 	TEST.exe!CWnd::OnCommand(unsigned int wParam=32902, long lParam=0)  Line 2364	C++
 	TEST.exe!CFrameWnd::OnCommand(unsigned int wParam=32902, long lParam=0)  Line 366	C++
 	TEST.exe!CFrameWndEx::OnCommand(unsigned int wParam=32902, long lParam=0)  Line 359 + 0x10 bytes	C++
 	TEST.exe!CWnd::OnWndMsg(unsigned int message=273, unsigned int wParam=32902, long lParam=0, long * pResult=0x015cfcd8)  Line 1769 + 0x1e bytes	C++
 	TEST.exe!CWnd::WindowProc(unsigned int message=273, unsigned int wParam=32902, long lParam=0)  Line 1755 + 0x20 bytes	C++
 	TEST.exe!AfxCallWndProc(CWnd * pWnd=0x0039a4a0, HWND__ * hWnd=0x00190eae, unsigned int nMsg=273, unsigned int wParam=32902, long lParam=0)  Line 240 + 0x1c bytes	C++
 	TEST.exe!AfxWndProc(HWND__ * hWnd=0x00190eae, unsigned int nMsg=273, unsigned int wParam=32902, long lParam=0)  Line 403	C++
 	user32.dll!7e418734() 	
 	user32.dll!7e418816() 	
 	user32.dll!7e4189cd() 	
 	user32.dll!7e418a10() 	
 	TEST.exe!AfxInternalPumpMessage()  Line 183	C++
 	TEST.exe!CWinThread::PumpMessage()  Line 900	C++
 	TEST.exe!CWinThread::Run()  Line 629 + 0xd bytes	C++
 	TEST.exe!CWinApp::Run()  Line 865	C++
 	TEST.exe!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020882, int nCmdShow=1)  Line 47 + 0xd bytes	C++
 	TEST.exe!wWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020882, int nCmdShow=1)  Line 34	C++
 	TEST.exe!__tmainCRTStartup()  Line 263 + 0x2c bytes	C
 	TEST.exe!wWinMainCRTStartup()  Line 182	C
 	kernel32.dll!7c817077() 	



Please help.
Thanking you,
Ashwath.
AnswerRe: Heap Error Pin
CPallini23-Apr-10 2:33
mveCPallini23-Apr-10 2:33 
JokeRe: Heap Error Pin
Chris Meech23-Apr-10 6:12
Chris Meech23-Apr-10 6:12 
GeneralOT Pin
CPallini23-Apr-10 9:33
mveCPallini23-Apr-10 9:33 
GeneralRe: OT Pin
Chris Meech23-Apr-10 10:03
Chris Meech23-Apr-10 10:03 
GeneralRe: OT Pin
CPallini23-Apr-10 22:26
mveCPallini23-Apr-10 22:26 
AnswerRe: Heap Error Pin
«_Superman_»23-Apr-10 6:25
professional«_Superman_»23-Apr-10 6:25 
AnswerRe: Heap Error Pin
Gary R. Wheeler24-Apr-10 0:22
Gary R. Wheeler24-Apr-10 0:22 
QuestionHave anybody catch an Exception on pdflib 5 ? Pin
mesajflaviu23-Apr-10 1:51
mesajflaviu23-Apr-10 1:51 
AnswerRe: Have anybody catch an Exception on pdflib 5 ? Pin
freakyit23-Apr-10 2:09
freakyit23-Apr-10 2:09 
AnswerRe: Have anybody catch an Exception on pdflib 5 ? Pin
Chris Meech23-Apr-10 5:56
Chris Meech23-Apr-10 5:56 
GeneralRe: Have anybody catch an Exception on pdflib 5 ? Pin
mesajflaviu23-Apr-10 8:13
mesajflaviu23-Apr-10 8:13 
AnswerRe: Have anybody catch an Exception on pdflib 5 ? Pin
mesajflaviu23-Apr-10 8:21
mesajflaviu23-Apr-10 8:21 
Questiongnuwin32 flex problem with iostream when using flex with -+ switch and the header file FlexLexer.h compiling with VS2005 Pin
User 2694223-Apr-10 0:20
professionalUser 2694223-Apr-10 0:20 
AnswerRe: gnuwin32 flex problem with iostream when using flex with -+ switch and the header file FlexLexer.h compiling with VS2005 Pin
Saurabh.Garg23-Apr-10 1:10
Saurabh.Garg23-Apr-10 1:10 
GeneralRe: gnuwin32 flex problem with iostream when using flex with -+ switch and the header file FlexLexer.h compiling with VS2005 Pin
User 2694223-Apr-10 1:28
professionalUser 2694223-Apr-10 1:28 
AnswerRe: gnuwin32 flex problem with iostream when using flex with -+ switch and the header file FlexLexer.h compiling with VS2005 Pin
User 2694223-Apr-10 1:24
professionalUser 2694223-Apr-10 1:24 
GeneralRe: gnuwin32 flex problem with iostream when using flex with -+ switch and the header file FlexLexer.h compiling with VS2005 Pin
flyontheweb20-May-10 1:38
flyontheweb20-May-10 1:38 

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.