Advertisement Jump to content
Sign in to follow this  

conversion problem

This topic is 4936 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
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]


Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!