Sign in to follow this  
DrZoidberg

Debugging w/ Visual Studio Express

Recommended Posts

hello, i've just recently started using Visual Studio Express and am quite pleased with it, however i have run into a few strange debugging issues. i'm working on a simple poker game using allegro. the problem arises when the card images are loaded and split into multiple images. VS tells me this: "Unhandled exception at 0x10004954 (alleg40.dll) in Poker.exe: 0xC0000005: Access violation reading location 0x00000000." then points to a line in the disassembler "10004954 mov ecx,dword ptr [edx]" but doesnt actually point to the line in the code. i figured it was just some mistyped number in the routine for splitting the bitmaps so i checked and rechecked but it all looked good, so i just created a logger which would spit out some info about the progress of the splitting and i could check it over. so i did that, and the file doesnt get created at all. so i then tryed to run it from explorer and not the ide ... and it worked, nothing wrong. so this leads me to beleive that when in debug mode no files can be read or written. this sucks! does anyone know how or why this is happening? and if there is an option in VS to disable this, or if i am doing something terribly wrong? thanks for any help in advance.

Share this post


Link to post
Share on other sites
Quote:
Original post by DrZoidberg
VS tells me this: "Unhandled exception at 0x10004954 (alleg40.dll) in Poker.exe: 0xC0000005: Access violation reading location 0x00000000." then points to a line in the disassembler "10004954 mov ecx,dword ptr [edx]" but doesnt actually point to the line in the code.
It's not showing a source file because the access violation is in alleg40.dll (Allegro?), not your application. The "Access violation reading location 0x00000000" tells you that it's a NULL pointer issue. So, you're probably calling an allegro function with a NULL pointer. If VS is running it with a different working directory as Deyja says, then presumably file loading failed, and you ended up passing a NULL pointer to Allegro.

Share this post


Link to post
Share on other sites
i originally thought it was using a differnt directory aswell, but if i do this ...

ofstream out("C:\something.txt");
out << "something";
out.close();

no file gets created at all, and no error occurs. after the program has ended i have run a search and no file is created.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this