after sometime of running, i get an error from Operation System and then i get these message on IDE: "Process terminated with status -1073741819 (0 minute(s), 15 second(s))"
what means these message?
after sometime of running, i get an error from Operation System and then i get these message on IDE: "Process terminated with status -1073741819 (0 minute(s), 15 second(s))"
what means these message?
Convert it into hex, and you get C0000005
This (if you look it up) means an access violation of some sort. This typically means an out of bound memory access.
Run the code in the debugger to find out more.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Can you be more specific than "I'm having problems"?
Have you asked on the code blocks forums about debugger setup issues?
Does the debugger actually work, and you're not yet skilled enough to use it effectively?
Sorry, but knowing how to use the debugger goes with the territory. Consider this an opportunity to configure your development environment and learn a new skill.
After you're done learning how to use a debugger, the next thing to learn about would be source control.
Comparison of version control software - Wikipedia, the free encyclopedia
The idea being you commit regular know working code to your repository, so that if something does break, it's a simple matter to either revert all your changes back to a good state, or do "diff" to find out what the incremental change was to cause all the grief.
> i'm sorry, but do you have another advice for find that problem and maybe more?
You could add copious amounts of debugging print statements and hope that you're not trying to find a Heisenbug.
But seriously, this gets painful in a hurry for anything more complicated than the typical singe source file homework assignment.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
i just run on Debug/Continue toolbar button(on IDE) and i get these output:
the Call Back window(the selection blue was red)):Building to ensure sources are up-to-date
Selecting target:
Release
Adding source dir: C:\Users\Cambalinho\Documents\CodeBlocks\classcont rols\
Adding source dir: C:\Users\Cambalinho\Documents\CodeBlocks\classcont rols\
Adding file: C:\Users\Cambalinho\Documents\CodeBlocks\classcont rols\bin\Release\classcontrols.exe
Changing directory to: C:/Users/Cambalinho/Documents/CodeBlocks/classcontrols/bin/Release
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\mingw32\i686-w64-mingw32\lib;C:\Program Files (x86)\CodeBlocks\mingw32\bin;C:\Program Files (x86)\CodeBlocks\mingw32;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32;C:\Windows;C:\Windows\Sys tem32\wbem;C:\Program Files (x86)\PC Connectivity Solution;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Jav a\javapath;C:\Windows\System32\WindowsPowerShell\v 1.0;C:\Program Files\Broadcom\Broadcom 802.11\Driver;C:\Program Files (x86)\Skype\Phone;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files (x86)\Microsoft Visual Studio\Common\Tools;C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin;C:\Program Files (x86)\Dr. Memory\bin
Starting debugger: C:\Program Files (x86)\CodeBlocks\mingw32\bin\gdb.exe -nx -fullname -quiet -args C:/Users/Cambalinho/Documents/CodeBlocks/classcontrols/bin/Release/classcontrols.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.6
Child process PID: 4056
In ntdll!ZwClose () (C:\Windows\system32\ntdll.dll)
Continuing...
In ntdll!ZwClose () (C:\Windows\system32\ntdll.dll)
Continuing...
[Inferior 1 (process 4056) exited with code 030000000010]
Debugger finished with status 0
what these means?
the error happens much more faster and the program is closed.
Last edited by joaquim; 06-11-2016 at 05:54 PM.
> Adding file: C:\Users\Cambalinho\Documents\CodeBlocks\classcont rols\bin\Release\classcontrols.exe
You'll get a lot further by trying to debug the debug version of the code, not the release version.
For example, all the parameters on the call stack will list the values (not just the types).
Though it is odd that the call stack begins with image :: effects and not main()
Still, putting a breakpoint in image :: effects where it creates a Menu would seem to be a good place to start.
Make sure all the parameters to create a Menu are valid and correct.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
"Though it is odd that the call stack begins with image :: effects and not main()"
because i changed the file name on imgIcon, image object, before main., using the constructor.
i'm confused with 1 thing: why, on Debugger, the program terminates on execution\start?
(finaly i puted the CppCheck, program, working and i fixed several errors on code.... i can't use above 1.57, because i get several errors of missing files)
Are you saying the error occurred during the initialisation of global constructors, before main() is even called?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
i'm sorry but i found another big problem: using Desktop Manager(where we see the processes on windows), i see the GDI objects growing. normaly these happens when the GDI object isn't destroyed, but i don't get all the info
i have the GDIViewer, but don't have all collumns for i get sure where is the problem.
can you advice me more?
finally i found the problem:
- when i executed the Debugger, the Debugger just close it. i was using a wrong 'if' on timer callback. i delete it, because i don't need it and now i can Debug the program normaly.
now i see some problems, on Debugger:
1 - the Multithread class give me problems with code\thread order, but on run, it works... why these problem?
2 - when i click on menu item, i get a Debugger pause and these output:
"Program received signal SIGSEGV, Segmentation fault.
In ?? () ()"
what these means?
It usually means you tried to dereference a null pointer or a freed pointer. In actually, what it means is that you're trying to access memory you're not allowed to read or write. If you get no stack trace, it usually means you corrupted the stack.
i'm sorry, in these case i don't see how
when i click on menu item, i get the Menu class object that calls the Click lambda. on normal run, these works normaly... maybe 10%(or less) of times give me an error.
see the code:
but tell me what you thinkCode://on form procedure: case WM_MENUCOMMAND: { MENUITEMINFO menuInfo; menuInfo.cbSize = sizeof(MENUITEMINFO); menuInfo.fMask=MIIM_DATA; if(GetMenuItemInfo((HMENU)lParam,(UINT) wParam, TRUE, &menuInfo )!=0) { Menu *mMenu = (Menu *) menuInfo.dwItemData; if(mMenu!=NULL) { if(mMenu->Click) mMenu->Click(); //mMenu->imgMenu.reset(); } return 0; } //menuhandle=NULL; } break; //on menu creation: (string caption, Menu &submenu, HWND MainHWND=ActivatedForm) { //calculate the ID intID=intID+1; ID=intID; Mainwindow=MainHWND; static int i=0; //calculate the caption //i'm changing these too strCaption=caption; if (strCaption=="") strCaption=(string)caption + " " + to_string(ID); //getting the menu bar handle if the submenu is null mnuBar = GetMenu(Mainwindow); if(mnuBar==NULL) mnuBar = CreateMenu(); //change the subitem to be a popup menu if(submenu.ispopup==false) { HMENU hSubMenu=CreatePopupMenu(); ModifyMenu(submenu.mnuBar,submenu.menuposition,MF_BYPOSITION| MF_POPUP|MF_STRING,(UINT_PTR)hSubMenu, submenu.strCaption.c_str()); submenu.MenuHandle=hSubMenu;//is where the submenu is created if(strCaption=="-") AppendMenu(hSubMenu, MF_SEPARATOR, ID, strCaption.c_str()); else AppendMenu(hSubMenu, MF_STRING, ID, strCaption.c_str()); SetMenu(MainHWND, submenu.mnuBar); MenuHandle=hSubMenu; //SetMenu(MainHWND, GetMenu(MainHWND)); MenuPopup=hSubMenu; submenu.ispopup=true; menuposition=GetMenuItemCount(MenuPopup)-1; //DebugText(strCaption); i++; } //add a new item on subtmenu popup menu else { if(strCaption=="-") AppendMenu(submenu.MenuHandle, MF_SEPARATOR, ID, strCaption.c_str()); else AppendMenu(submenu.MenuHandle, MF_STRING, ID, strCaption.c_str()); MenuHandle=(HMENU)submenu.MenuHandle;//the menu handle is the popup menu handle... instead the item menu handle :( MenuPopup=(HMENU)submenu.MenuHandle; ispopup=false; menuposition=GetMenuItemCount(MenuPopup)-1; SetMenu(MainHWND, mnuBar);//update the menu } //SetMenu(MainHWND, GetMenu(MainHWND));//update the menu //add menu messages\notifications: MENUINFO mnInfo; mnInfo.cbSize=sizeof(MENUINFO); mnInfo.fMask=MIM_STYLE; GetMenuInfo(GetMenu(MainHWND),&mnInfo); mnInfo.cbSize=sizeof(MENUINFO); mnInfo.fMask=MIM_STYLE | MIM_APPLYTOSUBMENUS; mnInfo.dwStyle=MNS_NOTIFYBYPOS; SetMenuInfo(GetMenu(MainHWND),&mnInfo); //put the this on dwItemData: MENUITEMINFO s; s.cbSize=sizeof(MENUITEMINFO ); s.fMask=MIIM_DATA; GetMenuItemInfo (MenuPopup,menuposition, true, &s); s.cbSize=sizeof(MENUITEMINFO ); s.fMask=MIIM_DATA; s.dwItemData=(ULONG_PTR)this; SetMenuItemInfo (MenuPopup,menuposition, true, &s); CreateShortCuts(); imgMenu.DrawImage=[&](int subimage) { imgMenu.Backcolor=GetSysColor(COLOR_MENU); //imgMenu.effects(GetPixel(imgMenu,imgMenu.width()-1, imgMenu.height()-1), GetSysColor(COLOR_MENU)); if(blncheck==true) { imgMenu.DrawRectangle(0,0,10,10); imgMenu.DrawControlBackground("MENU",MENU_POPUPCHECK,MC_CHECKMARKNORMAL,{0,0,10, 10}); } if(ImageChanged) ImageChanged(subimage); SetMenuItemBitmaps(MenuPopup,menuposition,MF_BYPOSITION, imgMenu ,imgMenu); Refresh(); }; }
i did, without notice some errors:
1 - not testing the return value on menu functions;
2 - i did a static members on form, for dispose the form before end the program.
thanks to all