Jump to content
  • Advertisement
Sign in to follow this  
majak

conversion problem

This topic is 4872 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I can build my project, but get this error when compiling: First-chance exception at 0x100033a8 in CreateTexture.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd. An unhandled exception of type 'System.NullReferenceException' occurred in CreateTexture.exe Additional information: Object reference not set to an instance of an object. This is why:
int size = nbPixels;							
PUCHAR *pixelBuffer = new PUCHAR[size];				
int var = retrieveAndRender(*pixelBuffer, the_Device);

How do I fix that? The function I'm calling is: OCT_API int retrieveAndRender(PUCHAR picRef, unsigned long adr); I don't know what an PUCHAR is, so I don't know what else to do.

Share this post


Link to post
Share on other sites
Advertisement
The hex code, 0xCDCDCDCD you mention is one of the special codes that the debug runtime will fill parts of RAM with to make debugging easier [smile]

From this page, your code corresponds to "Allocated in heap, but not initialized"

This line seems to be passing in the value of the pointer - that is the actual address if I'm not mistaken.

int var = retrieveAndRender(*pixelBuffer, the_Device);

Removing the "*" and making it:

int var = retrieveAndRender(pixelBuffer, the_Device);

Should work [smile]

hth
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!