Sign in to follow this  
the_regular1

Problem Plotting Pixels

Recommended Posts

the_regular1    122
http://rafb.net/paste/results/G51FNA27.html Above is the site with my code. My problem is that when I run the program, everthing seems to be in order; the pixel gets plotted, and it doesn't freeze up. But when I close the app, one of those microsoft "An error occured in Text.exe and needs to close" errors. When I run the debugger, the only bad line is line 128 video_buffer[x+y*mempitch] = color; statement. The debugger releases these two errors concerning that line: "Unhandled exception in Test.exe: 0xC0000005: Access Violation." and when I look at the variable properties of *video_buffer, it says "expression cannot be evaluated". Could someone help me? Thanks.

Share this post


Link to post
Share on other sites
Illco    928
I couldn't spot why, but my best guess is that the video memory access is performed after the application has been deinitialized. This might be due to an additional message coming in after WM_QUIT. This can be prevented by including a guard which specifies if the application is active, and subsequently only render when it is and setting it to non-active on WM_QUIT.

Greetz,

Illco

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