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. 0xC000041D: An unhandled exception was encountered during a user callback.

0xC000041D: An unhandled exception was encountered during a user callback.

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++debugginghelpannouncement
7 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.
  • A Offline
    A Offline
    Austin Donaghy
    wrote on last edited by
    #1

    This break in CWnd::WindowProc randomly appears when running my application(originally released in 2010 and runs 24/7 in many places) in debug. In release mode it crashes. The message type is always 874(x36A). The only true call backs I have are for custom draw list boxes and typically when I have an error in those routines MFC catches and breaks at that point. Obviously that are countless other messages processed. I am trying to determine A: what is message 874? and B: what circumstances cause it to be posted (though A may answer B)?

    L J V L 4 Replies Last reply
    0
    • A Austin Donaghy

      This break in CWnd::WindowProc randomly appears when running my application(originally released in 2010 and runs 24/7 in many places) in debug. In release mode it crashes. The message type is always 874(x36A). The only true call backs I have are for custom draw list boxes and typically when I have an error in those routines MFC catches and breaks at that point. Obviously that are countless other messages processed. I am trying to determine A: what is message 874? and B: what circumstances cause it to be posted (though A may answer B)?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I cannot find the specific message number in Winuser.h in VS 2013, but I did find the following two lines:

      #define WM_AFXFIRST 0x0360
      #define WM_AFXLAST 0x037F

      Googling for WM_AFXFIRST came up with: WM_AFXFIRST - Google Search[^].

      A 1 Reply Last reply
      0
      • A Austin Donaghy

        This break in CWnd::WindowProc randomly appears when running my application(originally released in 2010 and runs 24/7 in many places) in debug. In release mode it crashes. The message type is always 874(x36A). The only true call backs I have are for custom draw list boxes and typically when I have an error in those routines MFC catches and breaks at that point. Obviously that are countless other messages processed. I am trying to determine A: what is message 874? and B: what circumstances cause it to be posted (though A may answer B)?

        J Offline
        J Offline
        Jochen Arndt
        wrote on last edited by
        #3

        Message 0x036A is WM_KICKIDLE (defined in afxpriv.h). It is a private MFC message used to update the UI (e.g. menu items, tool bar buttons and the status bar). So you might check your UI update handlers if one of those is the error source.

        A 1 Reply Last reply
        0
        • J Jochen Arndt

          Message 0x036A is WM_KICKIDLE (defined in afxpriv.h). It is a private MFC message used to update the UI (e.g. menu items, tool bar buttons and the status bar). So you might check your UI update handlers if one of those is the error source.

          A Offline
          A Offline
          Austin Donaghy
          wrote on last edited by
          #4

          Thanks - I must have been too tired to figure that one out.

          1 Reply Last reply
          0
          • L Lost User

            I cannot find the specific message number in Winuser.h in VS 2013, but I did find the following two lines:

            #define WM_AFXFIRST 0x0360
            #define WM_AFXLAST 0x037F

            Googling for WM_AFXFIRST came up with: WM_AFXFIRST - Google Search[^].

            A Offline
            A Offline
            Austin Donaghy
            wrote on last edited by
            #5

            Thanks - I found those two - Jochen below narrowed it down.

            1 Reply Last reply
            0
            • A Austin Donaghy

              This break in CWnd::WindowProc randomly appears when running my application(originally released in 2010 and runs 24/7 in many places) in debug. In release mode it crashes. The message type is always 874(x36A). The only true call backs I have are for custom draw list boxes and typically when I have an error in those routines MFC catches and breaks at that point. Obviously that are countless other messages processed. I am trying to determine A: what is message 874? and B: what circumstances cause it to be posted (though A may answer B)?

              V Offline
              V Offline
              Victor Nijegorodov
              wrote on last edited by
              #6

              Austin Donaghy wrote:

              This break in CWnd::WindowProc randomly appears when running my application(originally released in 2010 and runs 24/7 in many places) in debug. In release mode it crashes.

              There is a good essay of Joe Newcomer: Debug vs. Release[^] I'd recommend to check it out!

              1 Reply Last reply
              0
              • A Austin Donaghy

                This break in CWnd::WindowProc randomly appears when running my application(originally released in 2010 and runs 24/7 in many places) in debug. In release mode it crashes. The message type is always 874(x36A). The only true call backs I have are for custom draw list boxes and typically when I have an error in those routines MFC catches and breaks at that point. Obviously that are countless other messages processed. I am trying to determine A: what is message 874? and B: what circumstances cause it to be posted (though A may answer B)?

                L Offline
                L Offline
                leon de boer
                wrote on last edited by
                #7

                99% of the time if you get a difference between release and debug mode you forgot to zero a variable and assume it is. Turn the warning levels up to full and you should get a warning saying "use of uninitialized variable". Usually it is something like this

                int Bad (int someval){
                int i;
                if (someval > 0){
                i = 1;
                }
                if (i == 0) return (1);
                return (0);
                }

                In debug mode all local variables are zeroed automatically. That simply doesn't happen in release mode the variables will start at whatever rubbish was in the stack at the position it was allocated. In the above code the behaviour of "bad" is totally predictable in debug mode as "i" will always start at 0. In release mode you have no idea what is going to happen as "i" could start at any value and the return is purely chance based. Look carefully at the code, now try compiling it and tell me if you get a warning :-)

                In vino veritas

                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