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. Debugbuild OK! Release build CRASHES! WHY?

Debugbuild OK! Release build CRASHES! WHY?

Scheduled Pinned Locked Moved C / C++ / MFC
c++debuggingquestionannouncement
6 Posts 5 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.
  • M Offline
    M Offline
    Michael Pauli
    wrote on last edited by
    #1

    Hi! I've just about to release a new MFC app. All works in debug ver. When I go to release it crashes when I work with radio buttons - always at L-button up from selecting a new radio btn. Then I do the classics: Change from/to all thinkable optimazations - nothing happens! Can anyone of you think of why? It has no effect to build with MFC-dll's as static. ????????????? Regards Michael Mogensen, dev. mm it-consult dk.

    A R N J 4 Replies Last reply
    0
    • M Michael Pauli

      Hi! I've just about to release a new MFC app. All works in debug ver. When I go to release it crashes when I work with radio buttons - always at L-button up from selecting a new radio btn. Then I do the classics: Change from/to all thinkable optimazations - nothing happens! Can anyone of you think of why? It has no effect to build with MFC-dll's as static. ????????????? Regards Michael Mogensen, dev. mm it-consult dk.

      A Offline
      A Offline
      Andres Manggini
      wrote on last edited by
      #2

      Hi, Keep in mind that in debug mode your pointer variables are initialized, in release they are not, maybe you are counting on a certain value on a non initialized variable ?. if you can post some code perhaps we can help you more. Andres Manggini. Buenos Aires - Argentina.

      1 Reply Last reply
      0
      • M Michael Pauli

        Hi! I've just about to release a new MFC app. All works in debug ver. When I go to release it crashes when I work with radio buttons - always at L-button up from selecting a new radio btn. Then I do the classics: Change from/to all thinkable optimazations - nothing happens! Can anyone of you think of why? It has no effect to build with MFC-dll's as static. ????????????? Regards Michael Mogensen, dev. mm it-consult dk.

        R Offline
        R Offline
        Ralph Varjabedian
        wrote on last edited by
        #3

        Pay Good attention to code that is written in ASSERT statments (or any code/macro that is excuted in debug builds only). This code is only called in Debug Versions. For example if you have something like this CWnd *pWnd = NULL; ASSERT(pWnd = GetDlgItem(ID_ANYTHING)); pWnd->ShowWindow(SW_HIDE); This code will crash under release but will work under debug ;) Change the ASSERT into VERIFY. Ralph Varjabedian Software Engineer

        1 Reply Last reply
        0
        • M Michael Pauli

          Hi! I've just about to release a new MFC app. All works in debug ver. When I go to release it crashes when I work with radio buttons - always at L-button up from selecting a new radio btn. Then I do the classics: Change from/to all thinkable optimazations - nothing happens! Can anyone of you think of why? It has no effect to build with MFC-dll's as static. ????????????? Regards Michael Mogensen, dev. mm it-consult dk.

          N Offline
          N Offline
          Neville Franks
          wrote on last edited by
          #4

          You need to read: "Surviving the Release Version" http://www.codeproject.com/debug/survivereleasever.asp[^]. Also the Debugger should help pinpoint the error fairly quickly. If you still can't work it out post some code. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com

          1 Reply Last reply
          0
          • M Michael Pauli

            Hi! I've just about to release a new MFC app. All works in debug ver. When I go to release it crashes when I work with radio buttons - always at L-button up from selecting a new radio btn. Then I do the classics: Change from/to all thinkable optimazations - nothing happens! Can anyone of you think of why? It has no effect to build with MFC-dll's as static. ????????????? Regards Michael Mogensen, dev. mm it-consult dk.

            J Offline
            J Offline
            JT Anderson
            wrote on last edited by
            #5

            One of the most common causes of this that I have seen is due to message handlers that don't have the correct signatures. I'm pretty sure the article that Neville mentioned discusses this issue. You might want to read KB article Q195032. If you are using VC 6, you can send me an email containing your email address and I'll send you a modified version of afxmsg_.h that contains the changes suggested in Q195032. This will catch most cases of message handlers with incorrect signatures. -------- There are 10 types of people in this world. Those who know binary and those who don't.

            M 1 Reply Last reply
            0
            • J JT Anderson

              One of the most common causes of this that I have seen is due to message handlers that don't have the correct signatures. I'm pretty sure the article that Neville mentioned discusses this issue. You might want to read KB article Q195032. If you are using VC 6, you can send me an email containing your email address and I'll send you a modified version of afxmsg_.h that contains the changes suggested in Q195032. This will catch most cases of message handlers with incorrect signatures. -------- There are 10 types of people in this world. Those who know binary and those who don't.

              M Offline
              M Offline
              Michael Pauli
              wrote on last edited by
              #6

              Thank you for your kind answer! I an using VS6.0 yes - I look forward to a mail from you! Thanx' again! Regards, Michael Mogensen, mm it-consult dk.

              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