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. Application getting carshed in release mode not in debug, in the follwing scenario

Application getting carshed in release mode not in debug, in the follwing scenario

Scheduled Pinned Locked Moved C / C++ / MFC
helpalgorithmsdata-structuresdebuggingannouncement
5 Posts 4 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
    Amrit Agr
    wrote on last edited by
    #1

    Hi Developers, Today I ahve faced a strange issue, that my application is gettong crsshed in release exe but not in debug mode. The scenario is that i am clicking on the items of a tree controls very rapidly. It is searching functionality & top searched (from the user) has given on the tree. Code of click event of that tree is mapped like this ON_NOTIFY(NM_CLICK, IDC_TREETOPSEARCH, &CRepLiveSearch::OnClickTopSearch) And the function is here. UINT uiFlags = 0; const MSG* pMsg = GetCurrentMessage(); CTreeCtrl* pTreeCtrl = (CTreeCtrl*)GetDlgItem(pNMHDR->idFrom); CPoint point(pMsg->pt); pTreeCtrl->ScreenToClient(&point); HTREEITEM ht = pTreeCtrl->HitTest(point, &uiFlags); CString szSelWord = m_suggestionTree.GetItemText(ht); szSelWord = szSelWord.Left(szSelWord.Find('(')); m_edSearch.SetWindowText(szSelWord); *pResult = 0; Can u tell me what may be the problem. Thanks. Amrit Agrawal. Software Developer

    M R D 3 Replies Last reply
    0
    • A Amrit Agr

      Hi Developers, Today I ahve faced a strange issue, that my application is gettong crsshed in release exe but not in debug mode. The scenario is that i am clicking on the items of a tree controls very rapidly. It is searching functionality & top searched (from the user) has given on the tree. Code of click event of that tree is mapped like this ON_NOTIFY(NM_CLICK, IDC_TREETOPSEARCH, &CRepLiveSearch::OnClickTopSearch) And the function is here. UINT uiFlags = 0; const MSG* pMsg = GetCurrentMessage(); CTreeCtrl* pTreeCtrl = (CTreeCtrl*)GetDlgItem(pNMHDR->idFrom); CPoint point(pMsg->pt); pTreeCtrl->ScreenToClient(&point); HTREEITEM ht = pTreeCtrl->HitTest(point, &uiFlags); CString szSelWord = m_suggestionTree.GetItemText(ht); szSelWord = szSelWord.Left(szSelWord.Find('(')); m_edSearch.SetWindowText(szSelWord); *pResult = 0; Can u tell me what may be the problem. Thanks. Amrit Agrawal. Software Developer

      M Offline
      M Offline
      Madhu Nair 0
      wrote on last edited by
      #2

      Validate the pointers and HTREEITEM

      CTreeCtrl* pTreeCtrl = (CTreeCtrl*)GetDlgItem(pNMHDR->idFrom);
      //add this checking
      if(!pTreeCtrl)
      {
      // Some message and return
      }

      also

      HTREEITEM ht = pTreeCtrl->HitTest(point, &uiFlags);
      // add this checking
      if (ht != NULL)
      {
      pTreeCtrl->Select(ht, TVGN_CARET);
      }
      else
      {
      // Show some error message/return
      }

      A 1 Reply Last reply
      0
      • M Madhu Nair 0

        Validate the pointers and HTREEITEM

        CTreeCtrl* pTreeCtrl = (CTreeCtrl*)GetDlgItem(pNMHDR->idFrom);
        //add this checking
        if(!pTreeCtrl)
        {
        // Some message and return
        }

        also

        HTREEITEM ht = pTreeCtrl->HitTest(point, &uiFlags);
        // add this checking
        if (ht != NULL)
        {
        pTreeCtrl->Select(ht, TVGN_CARET);
        }
        else
        {
        // Show some error message/return
        }

        A Offline
        A Offline
        Amrit Agr
        wrote on last edited by
        #3

        Thanks a lot Madhu

        1 Reply Last reply
        0
        • A Amrit Agr

          Hi Developers, Today I ahve faced a strange issue, that my application is gettong crsshed in release exe but not in debug mode. The scenario is that i am clicking on the items of a tree controls very rapidly. It is searching functionality & top searched (from the user) has given on the tree. Code of click event of that tree is mapped like this ON_NOTIFY(NM_CLICK, IDC_TREETOPSEARCH, &CRepLiveSearch::OnClickTopSearch) And the function is here. UINT uiFlags = 0; const MSG* pMsg = GetCurrentMessage(); CTreeCtrl* pTreeCtrl = (CTreeCtrl*)GetDlgItem(pNMHDR->idFrom); CPoint point(pMsg->pt); pTreeCtrl->ScreenToClient(&point); HTREEITEM ht = pTreeCtrl->HitTest(point, &uiFlags); CString szSelWord = m_suggestionTree.GetItemText(ht); szSelWord = szSelWord.Left(szSelWord.Find('(')); m_edSearch.SetWindowText(szSelWord); *pResult = 0; Can u tell me what may be the problem. Thanks. Amrit Agrawal. Software Developer

          R Offline
          R Offline
          Roger Allen
          wrote on last edited by
          #4

          You should also check that the function prototype for CRepLiveSearch::OnClickTopSearch matches the correct signature. I had issues in the past where this did not match and would crash in release, but work ok in debug

          If you vote me down, my score will only get lower

          1 Reply Last reply
          0
          • A Amrit Agr

            Hi Developers, Today I ahve faced a strange issue, that my application is gettong crsshed in release exe but not in debug mode. The scenario is that i am clicking on the items of a tree controls very rapidly. It is searching functionality & top searched (from the user) has given on the tree. Code of click event of that tree is mapped like this ON_NOTIFY(NM_CLICK, IDC_TREETOPSEARCH, &CRepLiveSearch::OnClickTopSearch) And the function is here. UINT uiFlags = 0; const MSG* pMsg = GetCurrentMessage(); CTreeCtrl* pTreeCtrl = (CTreeCtrl*)GetDlgItem(pNMHDR->idFrom); CPoint point(pMsg->pt); pTreeCtrl->ScreenToClient(&point); HTREEITEM ht = pTreeCtrl->HitTest(point, &uiFlags); CString szSelWord = m_suggestionTree.GetItemText(ht); szSelWord = szSelWord.Left(szSelWord.Find('(')); m_edSearch.SetWindowText(szSelWord); *pResult = 0; Can u tell me what may be the problem. Thanks. Amrit Agrawal. Software Developer

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

            Amrit Agr wrote:

            ...my application is gettong crsshed...

            Crashed is such a meaningless term without any context.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

            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