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. These user breakpoints are driving me crazy! Please help.

These user breakpoints are driving me crazy! Please help.

Scheduled Pinned Locked Moved C / C++ / MFC
helpdata-structuresdebugging
3 Posts 2 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.
  • R Offline
    R Offline
    Redeemer dk
    wrote on last edited by
    #1

    Now my programs is acting really weird. What worked before now displays a "User breakpoint" error when i move my mouse over the "open file" dialog. Here's my browse dialog which worked fine before:

    void OnBrowse()
    {
    OPENFILENAME ofn;
    char szFileName[MAX_PATH+1];
    const char szFilter[] = "All Files (*.*)\0" "*.*\0";

    szFileName\[0\] = '\\0';
    ofn.lStructSize = sizeof(OPENFILENAME);
    
    ofn.hwndOwner = ghMainWnd;
    ofn.lpstrFilter = szFilter;
    ofn.lpstrCustomFilter = (LPSTR)NULL;
    ofn.nFilterIndex = 1;
    ofn.lpstrFile = szFileName;
    ofn.nMaxFile = sizeof(szFileName);
    ofn.lpstrFileTitle = NULL;
    ofn.lpstrInitialDir = NULL;
    ofn.lpstrTitle = (LPSTR)NULL;
    ofn.Flags = OFN\_ENABLESIZING | OFN\_FILEMUSTEXIST | OFN\_HIDEREADONLY | OFN\_PATHMUSTEXIST | OFN\_EXPLORER;
    ofn.nFileOffset = 0;
    ofn.nFileExtension = 0;
    ofn.lpstrDefExt = "";
    
    if (GetOpenFileName(&ofn))
    	SetDlgItemText(ghMainWnd, IDC\_SOURCEFILE, szFileName);
    

    }

    It worked fine before, but now when i have added a new function which should execute after the OnBrowse function is done, i get a "User breakpoint" message when i move my mouse over the dialog: Unhandled exception at 0x77f767cd in MP3.exe: User breakpoint. Here's the contents of the Call Stack when the erros appears:

    ntdll.dll!77f767cd() 	<- stops here
    ntdll.dll!77fa2f17() 	
    ntdll.dll!77f842f4() 	
    ntdll.dll!77f635c7() 	
    msms001.vwp!017b7b68() 	
    msms001.vwp!017b7539() 	
    msms001.vwp!017afcf7() 	
    vct3216.dll!00c34326() 	
    

    And this appears in the Output pane:

    HEAP[MP3.exe]: Invalid Address specified to RtlFreeHeap( 01810000, 01814270 )
    Unhandled exception at 0x77f767cd in MP3.exe: User breakpoint.

    All help is appreciated. -Rune Svendsen

    B 1 Reply Last reply
    0
    • R Redeemer dk

      Now my programs is acting really weird. What worked before now displays a "User breakpoint" error when i move my mouse over the "open file" dialog. Here's my browse dialog which worked fine before:

      void OnBrowse()
      {
      OPENFILENAME ofn;
      char szFileName[MAX_PATH+1];
      const char szFilter[] = "All Files (*.*)\0" "*.*\0";

      szFileName\[0\] = '\\0';
      ofn.lStructSize = sizeof(OPENFILENAME);
      
      ofn.hwndOwner = ghMainWnd;
      ofn.lpstrFilter = szFilter;
      ofn.lpstrCustomFilter = (LPSTR)NULL;
      ofn.nFilterIndex = 1;
      ofn.lpstrFile = szFileName;
      ofn.nMaxFile = sizeof(szFileName);
      ofn.lpstrFileTitle = NULL;
      ofn.lpstrInitialDir = NULL;
      ofn.lpstrTitle = (LPSTR)NULL;
      ofn.Flags = OFN\_ENABLESIZING | OFN\_FILEMUSTEXIST | OFN\_HIDEREADONLY | OFN\_PATHMUSTEXIST | OFN\_EXPLORER;
      ofn.nFileOffset = 0;
      ofn.nFileExtension = 0;
      ofn.lpstrDefExt = "";
      
      if (GetOpenFileName(&ofn))
      	SetDlgItemText(ghMainWnd, IDC\_SOURCEFILE, szFileName);
      

      }

      It worked fine before, but now when i have added a new function which should execute after the OnBrowse function is done, i get a "User breakpoint" message when i move my mouse over the dialog: Unhandled exception at 0x77f767cd in MP3.exe: User breakpoint. Here's the contents of the Call Stack when the erros appears:

      ntdll.dll!77f767cd() 	<- stops here
      ntdll.dll!77fa2f17() 	
      ntdll.dll!77f842f4() 	
      ntdll.dll!77f635c7() 	
      msms001.vwp!017b7b68() 	
      msms001.vwp!017b7539() 	
      msms001.vwp!017afcf7() 	
      vct3216.dll!00c34326() 	
      

      And this appears in the Output pane:

      HEAP[MP3.exe]: Invalid Address specified to RtlFreeHeap( 01810000, 01814270 )
      Unhandled exception at 0x77f767cd in MP3.exe: User breakpoint.

      All help is appreciated. -Rune Svendsen

      B Offline
      B Offline
      Bart Robeyns
      wrote on last edited by
      #2

      You actually should be thankful for the user-breakpoint: it is called by the debug-version of your program, because an assert failed. RtlFreeHeap even tells you why it failed: you're trying to free a memory-block that either has been damaged or was never allocated. RtlFreeHeap knows this because it puts a signature before and after each allocated block and the signatures before the block you're trying to free don't match. Figure out which variable is being mishandled, and your program will stop acting weird. When you say it 'worked before', you're probably saying it worked in release-build: no assertions are being performed, and the RT will be happy to free anything you ask it to, even things that were never allocated.

      R 1 Reply Last reply
      0
      • B Bart Robeyns

        You actually should be thankful for the user-breakpoint: it is called by the debug-version of your program, because an assert failed. RtlFreeHeap even tells you why it failed: you're trying to free a memory-block that either has been damaged or was never allocated. RtlFreeHeap knows this because it puts a signature before and after each allocated block and the signatures before the block you're trying to free don't match. Figure out which variable is being mishandled, and your program will stop acting weird. When you say it 'worked before', you're probably saying it worked in release-build: no assertions are being performed, and the RT will be happy to free anything you ask it to, even things that were never allocated.

        R Offline
        R Offline
        Redeemer dk
        wrote on last edited by
        #3

        Thanks for your help. But how is it possible to find out what variable is being mishandled when the error happens when i move my mouse over the dialog created by the GetOpenFileName API? Thanks

        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