Page 1 of 1
C++ error: "Unhandled exception at" Visual Studio
Posted: Sat Aug 22, 2009 10:04 am
by Vortex
Unhandled exception at 0x6812851a in Editor.exe: 0xC0000005: Access violation reading location 0x0000323c.
when i try to run my program ( level editor ) from visual studio i get this error,
i have no idea how to fix this,
all info i can give is that it stops execution and show me this line of code
SDL_FillRect( screen, &screen->clip_rect, SDL_MapRGB( screen->format, 0xFF, 0xFF, 0xFF ) );
i dont see anything wrong with it and when i remove it it just sais the error is in another line of code,
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Sat Aug 22, 2009 10:08 am
by K-Bal
Have you tried running it with a debugger?
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Sat Aug 22, 2009 10:10 am
by Vortex
i run it with debug mode in visual studio if thats what you mean?
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Sat Aug 22, 2009 10:21 am
by Bludklok
We need some more source code...
Btw double check to make sure you declared all of the variables you are trying to use. (Make sure they have values and what not)
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Sat Aug 22, 2009 10:24 am
by Vortex
since i didint know what was wrong in the code i just uploaded all,
its mostly copied functions from lazy foo so thoose functions should be working i think
http://bitfile.se/files/p/Source.zip
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Sat Aug 22, 2009 10:27 am
by K-Bal
With a debugger you can step through your program linewise and get other useful information. It's not running the program in debug mode, but debug mode is important for the debugger to work correctly.
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Sun Aug 23, 2009 1:54 pm
by Vortex
is there a debugger in visual studio? how do i use it?
any other anwsers on my problem?
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Sun Aug 23, 2009 2:38 pm
by Bakkon
Yes, there's a debugger in Visual Studio. There should be a tab up top with all your debug tools.
This won't help your current problem, but a small tip...
Code: Select all
SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0xFF, 0xFF, 0xFF));
...will fill the entire surface, in your case, the whole screen.
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Sun Aug 23, 2009 3:05 pm
by Vortex
yeah, i dont see anything wrong with that line? ive tryed to remove it but i still get the error?
any hints?
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Sun Aug 23, 2009 3:26 pm
by Bakkon
Only thing I can think of is you didn't use SDL_SetVideoMode on the screen. We can't do much more for you without seeing some source or given better detail on the error.
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Mon Aug 24, 2009 9:36 am
by Vortex
source already linked
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Mon Aug 24, 2009 12:40 pm
by dandymcgee
Vortex wrote:source already linked
Not much use missing half of the files ( test.map, tileSheet.png, project file ).
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Tue Aug 25, 2009 10:46 am
by Vortex
the map file is supposed to be generated by the editor.
http://bitfile.se/files/p/tileSheet.png
tile sheet. not so high class but im actually proud for being the first tile like thing i ever drawn
http://bitfile.se/files/p/rar.rar
projekt file.
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Tue Aug 25, 2009 6:29 pm
by dandymcgee
Compiles and runs fine for me in Code::Blocks. Not sure what's up.
Re: C++ error: "Unhandled exception at" Visual Studio
Posted: Thu Aug 27, 2009 2:21 pm
by MarauderIIC
Vortex wrote:is there a debugger in visual studio? how do i use it?
any other anwsers on my problem? :(
http://www.lmgtfy.com/?q=using+debugger+in+visual+c%2B%2B