Sign in to follow this  
majak

conversion problem

Recommended Posts

majak    122
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
jollyjeffers    1570
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

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