Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Microsoft C++ Exception at kernel32.dll

Microsoft C++ Exception at kernel32.dll

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Neha
    wrote on last edited by
    #1

    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

    V 1 Reply Last reply
    0
    • N 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

      V Offline
      V Offline
      vcplusplus
      wrote on last edited by
      #2

      It should work assuming m_str is defined as

      double *m_str;

      N 1 Reply Last reply
      0
      • V vcplusplus

        It should work assuming m_str is defined as

        double *m_str;

        N Offline
        N Offline
        Neha
        wrote on last edited by
        #3

        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.

        V 1 Reply Last reply
        0
        • N Neha

          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.

          V Offline
          V Offline
          vcplusplus
          wrote on last edited by
          #4

          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.

          N 1 Reply Last reply
          0
          • V vcplusplus

            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.

            N Offline
            N Offline
            Neha
            wrote on last edited by
            #5

            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.

            7 1 Reply Last reply
            0
            • N Neha

              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.

              7 Offline
              7 Offline
              73Zeppelin
              wrote on last edited by
              #6

              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[^]

              N 1 Reply Last reply
              0
              • 7 73Zeppelin

                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[^]

                N Offline
                N Offline
                Neha
                wrote on last edited by
                #7

                I have done like this: if(m_str!=NULL) { delete [] m_str; m_str=NULL; }

                7 1 Reply Last reply
                0
                • N Neha

                  I have done like this: if(m_str!=NULL) { delete [] m_str; m_str=NULL; }

                  7 Offline
                  7 Offline
                  73Zeppelin
                  wrote on last edited by
                  #8

                  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[^]

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups