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. How can I Fix the Crash caused due to change of User-defined message ?

How can I Fix the Crash caused due to change of User-defined message ?

Scheduled Pinned Locked Moved C / C++ / MFC
data-structureshelpquestion
4 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.
  • S Offline
    S Offline
    SherTeks
    wrote on last edited by
    #1

    I've a user defined message defined as : #define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 3) the handler is : LRESULT CTreePropSheet::OnTreeItemCheckBoxClicked(WPARAM wParam, LPARAM lParam) { -- } When I modify the user defined message as : #define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 1) //(which is unique and no other user defined message is defined so) then, there is a crash in my application. A snippet of the call stack contents looks like this : For (WM_USER + 3) : (Successful case)

    TreePropSheet::CTreePropSheet::OnInitDialog() line 773
    CPropertySheet::HandleInitDialog(unsigned int 460026, unsigned int 460026) line 1209 + 14 bytes
    CWnd::OnWndMsg(unsigned int 272, unsigned int 460026, long 1452200, long * 0x0013f03c) line 1815 + 17 bytes
    CWnd::WindowProc(unsigned int 272, unsigned int 460026, long 1452200) line 1585 + 30 bytes
    AfxCallWndProc(CWnd * 0x0013f438 {TreePropSheet::CTreePropSheet hWnd=0x00080500}, HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 215 + 26 bytes
    AfxWndProc(HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 368
    AfxWndProcBase(HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 220 + 21 bytes

    For (WM_USER + 1) : (Unsuccessful case)

    TreePropSheet::CTreePropSheet::OnTreeItemCheckBoxClicked(unsigned int 1, long 0) line 1148 + 14 bytes
    CWnd::OnWndMsg(unsigned int 1025, unsigned int 1, long 0, long * 0x0013e310) line 1815 + 17 bytes
    CWnd::WindowProc(unsigned int 1025, unsigned int 1, long 0) line 1585 + 30 bytes
    AfxCallWndProc(CWnd * 0x0013f438 {TreePropSheet::CTreePropSheet hWnd=0x001a0222}, HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 215 + 26 bytes
    AfxWndProc(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 368
    AfxWndProcBase(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 220 + 21 bytes

    Actually, in Successful case, the OnTreeItemCheckBoxClicked() is not required to be called (as is happening in Unsuccessful case) because the event (of clicking tree item) as such has not occurred at all.The crash arises before launch of my dialog (which contains the tree control) itself. Can the cause of the crash be figured out from the call stack contents ? It appears that third and fourth (or either) parameters of the following function is causing the problem AfxWndProcBase(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 220 + 21 bytes Bu

    S S D 3 Replies Last reply
    0
    • S SherTeks

      I've a user defined message defined as : #define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 3) the handler is : LRESULT CTreePropSheet::OnTreeItemCheckBoxClicked(WPARAM wParam, LPARAM lParam) { -- } When I modify the user defined message as : #define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 1) //(which is unique and no other user defined message is defined so) then, there is a crash in my application. A snippet of the call stack contents looks like this : For (WM_USER + 3) : (Successful case)

      TreePropSheet::CTreePropSheet::OnInitDialog() line 773
      CPropertySheet::HandleInitDialog(unsigned int 460026, unsigned int 460026) line 1209 + 14 bytes
      CWnd::OnWndMsg(unsigned int 272, unsigned int 460026, long 1452200, long * 0x0013f03c) line 1815 + 17 bytes
      CWnd::WindowProc(unsigned int 272, unsigned int 460026, long 1452200) line 1585 + 30 bytes
      AfxCallWndProc(CWnd * 0x0013f438 {TreePropSheet::CTreePropSheet hWnd=0x00080500}, HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 215 + 26 bytes
      AfxWndProc(HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 368
      AfxWndProcBase(HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 220 + 21 bytes

      For (WM_USER + 1) : (Unsuccessful case)

      TreePropSheet::CTreePropSheet::OnTreeItemCheckBoxClicked(unsigned int 1, long 0) line 1148 + 14 bytes
      CWnd::OnWndMsg(unsigned int 1025, unsigned int 1, long 0, long * 0x0013e310) line 1815 + 17 bytes
      CWnd::WindowProc(unsigned int 1025, unsigned int 1, long 0) line 1585 + 30 bytes
      AfxCallWndProc(CWnd * 0x0013f438 {TreePropSheet::CTreePropSheet hWnd=0x001a0222}, HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 215 + 26 bytes
      AfxWndProc(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 368
      AfxWndProcBase(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 220 + 21 bytes

      Actually, in Successful case, the OnTreeItemCheckBoxClicked() is not required to be called (as is happening in Unsuccessful case) because the event (of clicking tree item) as such has not occurred at all.The crash arises before launch of my dialog (which contains the tree control) itself. Can the cause of the crash be figured out from the call stack contents ? It appears that third and fourth (or either) parameters of the following function is causing the problem AfxWndProcBase(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 220 + 21 bytes Bu

      S Offline
      S Offline
      SandipG
      wrote on last edited by
      #2

      SherTeks wrote:

      Or is there any other justifiable reason for not using (WM_USER + 1) ?

      Read here[^] and here[^] I hope it helps.

      Regards, Sandip.

      1 Reply Last reply
      0
      • S SherTeks

        I've a user defined message defined as : #define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 3) the handler is : LRESULT CTreePropSheet::OnTreeItemCheckBoxClicked(WPARAM wParam, LPARAM lParam) { -- } When I modify the user defined message as : #define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 1) //(which is unique and no other user defined message is defined so) then, there is a crash in my application. A snippet of the call stack contents looks like this : For (WM_USER + 3) : (Successful case)

        TreePropSheet::CTreePropSheet::OnInitDialog() line 773
        CPropertySheet::HandleInitDialog(unsigned int 460026, unsigned int 460026) line 1209 + 14 bytes
        CWnd::OnWndMsg(unsigned int 272, unsigned int 460026, long 1452200, long * 0x0013f03c) line 1815 + 17 bytes
        CWnd::WindowProc(unsigned int 272, unsigned int 460026, long 1452200) line 1585 + 30 bytes
        AfxCallWndProc(CWnd * 0x0013f438 {TreePropSheet::CTreePropSheet hWnd=0x00080500}, HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 215 + 26 bytes
        AfxWndProc(HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 368
        AfxWndProcBase(HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 220 + 21 bytes

        For (WM_USER + 1) : (Unsuccessful case)

        TreePropSheet::CTreePropSheet::OnTreeItemCheckBoxClicked(unsigned int 1, long 0) line 1148 + 14 bytes
        CWnd::OnWndMsg(unsigned int 1025, unsigned int 1, long 0, long * 0x0013e310) line 1815 + 17 bytes
        CWnd::WindowProc(unsigned int 1025, unsigned int 1, long 0) line 1585 + 30 bytes
        AfxCallWndProc(CWnd * 0x0013f438 {TreePropSheet::CTreePropSheet hWnd=0x001a0222}, HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 215 + 26 bytes
        AfxWndProc(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 368
        AfxWndProcBase(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 220 + 21 bytes

        Actually, in Successful case, the OnTreeItemCheckBoxClicked() is not required to be called (as is happening in Unsuccessful case) because the event (of clicking tree item) as such has not occurred at all.The crash arises before launch of my dialog (which contains the tree control) itself. Can the cause of the crash be figured out from the call stack contents ? It appears that third and fourth (or either) parameters of the following function is causing the problem AfxWndProcBase(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 220 + 21 bytes Bu

        S Offline
        S Offline
        SherTeks
        wrote on last edited by
        #3

        Thanks for the reply. The message was probably getting sent from one window to other bcoz the crash occurred after I clicked 'Ok' of one dialog and before the other dialog was launched. Defining WM_APP in lieu of WM_USER worked fixed the problem.

        1 Reply Last reply
        0
        • S SherTeks

          I've a user defined message defined as : #define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 3) the handler is : LRESULT CTreePropSheet::OnTreeItemCheckBoxClicked(WPARAM wParam, LPARAM lParam) { -- } When I modify the user defined message as : #define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 1) //(which is unique and no other user defined message is defined so) then, there is a crash in my application. A snippet of the call stack contents looks like this : For (WM_USER + 3) : (Successful case)

          TreePropSheet::CTreePropSheet::OnInitDialog() line 773
          CPropertySheet::HandleInitDialog(unsigned int 460026, unsigned int 460026) line 1209 + 14 bytes
          CWnd::OnWndMsg(unsigned int 272, unsigned int 460026, long 1452200, long * 0x0013f03c) line 1815 + 17 bytes
          CWnd::WindowProc(unsigned int 272, unsigned int 460026, long 1452200) line 1585 + 30 bytes
          AfxCallWndProc(CWnd * 0x0013f438 {TreePropSheet::CTreePropSheet hWnd=0x00080500}, HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 215 + 26 bytes
          AfxWndProc(HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 368
          AfxWndProcBase(HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 220 + 21 bytes

          For (WM_USER + 1) : (Unsuccessful case)

          TreePropSheet::CTreePropSheet::OnTreeItemCheckBoxClicked(unsigned int 1, long 0) line 1148 + 14 bytes
          CWnd::OnWndMsg(unsigned int 1025, unsigned int 1, long 0, long * 0x0013e310) line 1815 + 17 bytes
          CWnd::WindowProc(unsigned int 1025, unsigned int 1, long 0) line 1585 + 30 bytes
          AfxCallWndProc(CWnd * 0x0013f438 {TreePropSheet::CTreePropSheet hWnd=0x001a0222}, HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 215 + 26 bytes
          AfxWndProc(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 368
          AfxWndProcBase(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 220 + 21 bytes

          Actually, in Successful case, the OnTreeItemCheckBoxClicked() is not required to be called (as is happening in Unsuccessful case) because the event (of clicking tree item) as such has not occurred at all.The crash arises before launch of my dialog (which contains the tree control) itself. Can the cause of the crash be figured out from the call stack contents ? It appears that third and fourth (or either) parameters of the following function is causing the problem AfxWndProcBase(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 220 + 21 bytes Bu

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          SherTeks wrote:

          #define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 1) //(which is unique and no other user defined message is defined so)

          Are you 100% sure? The answer may surprise you.

          "Love people and use things, not love things and use people." - Unknown

          "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

          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