Problem Plotting Pixels

Started by
1 comment, last by the_regular1 18 years, 10 months ago
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.
Advertisement
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
Thanks a lot, I"ll look into that.

This topic is closed to new replies.

Advertisement