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