Skip to main content
gamedev.net
🔒 Locked

Memory Error

Started by tscott1213 2 replies 500+ views
Original Post
tscott1213
tscott1213
I am getting an error that I can't seem to debug. The program is using the CDisplay and CSurface classes, that microsoft included with DirectX 8.1b, to load bitmap files into memory as DDraw surfaces. I am getting the following error: The instruction at "0x009003039" referenced memory at "0x000065." The memory could not be "read." Interestingly, the error only happens on a specific bitmap that I am loading and if I change the order in which the bitmaps are loaded into memory the error doesn't happen at all. Thanks Todd [edited by - tscott1213 on February 27, 2003 9:56:14 PM]
tscott1213
tscott1213
OK, I''ve figured out that the bitmap is being loaded into memory but around halfway through the surface is garbage.

I am using the LoadImage() function to load the bitmap in from a file.

What is throwing me is that the error always occurs on the same bitmap but does not occur if I change the order in which bitmaps are loaded. (e.g. if I load the indicated ".bmp" file fourth or fifth it loads fine, but if I load it first or second it crashed).

Additionally, I am not getting the error at all on my desktop.

Thanks
Todd





Frankski
Frankski
Check your SetTexture()...

I have this problem (I discovered this today, didn''t have time to correct the problem). I know my code is not right and I should have done some of the things differently, but I receive this kind of error when I try to release a texture from a mesh I copied from another mesh (created a copy of another mesh...)

Anyway, I know this is due because I''m trying to release a texture of a CMesh object that was created from another pDevice pointer from another object. It screw things up, but in my case its because my code is not done right and I''m working on correcting this.

Frankski
tscott1213
tscott1213
I am using DirectDraw not D3D so I am just loading the bitmap onto a DDraw surface (no textures).

Todd

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.