Microsoft C++ Exception at kernel32.dll
-
Hi, I have a MFC based application,in that i am getting the following error: First-chance exception in mytest.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception. at m_str=new double[m_width*m_height] where m_width=256 and m_height=256; Could anyone help me solve this problem? Regards Neha
-
Hi, I have a MFC based application,in that i am getting the following error: First-chance exception in mytest.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception. at m_str=new double[m_width*m_height] where m_width=256 and m_height=256; Could anyone help me solve this problem? Regards Neha
It should work assuming m_str is defined as
double *m_str;
-
It should work assuming m_str is defined as
double *m_str;
-
Yes,it is double *. It is there in a algorithm which is repeatedly been called. It works fine for first 3 times,4th time it gives that exception message. If i press F5,then it will show up some assemply code,then if i press F5,it quits my application.
Are you deleting m_str before you call new again?
delete [] m_str
It still shouldn't crash even if you did not delete it. It would just cause a memory leak. Maybe the problem is somewhere else in your code and not the call to new. Maybe you could post a little bit more of you code.
-
Are you deleting m_str before you call new again?
delete [] m_str
It still shouldn't crash even if you did not delete it. It would just cause a memory leak. Maybe the problem is somewhere else in your code and not the call to new. Maybe you could post a little bit more of you code.
Yes, I do check for the existance of the object,if it is there then i will delete it before doing new. I run my program through Bouncechecker application, there is no memory or resource leaks. Even i think problem is somewhere else. But always exception occurs at that stmt. Code is too huge to post here. What puzzel's me is it works fine for first 3 times,4th time it throws the exception.
-
Yes, I do check for the existance of the object,if it is there then i will delete it before doing new. I run my program through Bouncechecker application, there is no memory or resource leaks. Even i think problem is somewhere else. But always exception occurs at that stmt. Code is too huge to post here. What puzzel's me is it works fine for first 3 times,4th time it throws the exception.
Neha wrote: Yes, I do check for the existance of the object,if it is there then i will delete it before doing new. How are you checking for the existence of the object? Chances are that this is causing the problem and you are trying to delete an object that does not exist. John Theal Physicist/Mathematical Programmer Digital Immersion Software Corporation Got CAD? http://www.presenter3d.com[^] http://www.merlin3d.com[^]
-
Neha wrote: Yes, I do check for the existance of the object,if it is there then i will delete it before doing new. How are you checking for the existence of the object? Chances are that this is causing the problem and you are trying to delete an object that does not exist. John Theal Physicist/Mathematical Programmer Digital Immersion Software Corporation Got CAD? http://www.presenter3d.com[^] http://www.merlin3d.com[^]
-
Hrm - the only problem I could see with that is that if the object that m_str is pointing to has lost scope, then m_str would not be NULL and calling delete on m_str could cause the exception... Just thought of something else...are you initializing m_str to NULL?? John Theal Physicist/Mathematical Programmer Digital Immersion Software Corporation Got CAD? http://www.presenter3d.com[^] http://www.merlin3d.com[^]