   Violation on Index Buffer
  m_pPlanetIB->Lock(0,0,(void**)&pdata,0);Access violation reading location 0x00000005.What does this mean? (Generally)   
  One of those pointers is probably pointing to something that doesn't exist. Check the following:a) Is the array pData large enough to hold all of the index buffer contents?b) Is m_pPlanetIB pointing to an actual index buffer?   ;  pdata is just a pointer so the amount of data it points to doesn't matter.andur's question b) appears to be the pertinent one. When you locked the index buffer m_pPlanetIB, did you check to ensure it's not NULL, that the LockIndexBuffer was successful?Just for completeness sake, what is your declaration for pdata?   ;  If you put no error checking or handling in your code then you'd better learn to love this 'crash and burn' style result. Good engineering practice should be a basic consideration in all code - it should not be thought of as optional.The debug runtimes will probably enlighten you to which call failed or is failing and why.hthJack   ;  Well it was working all along untill now, I added something to the code and it *seems* to be working properly, but I don't see how that could cause it to point to NULL..? However now that you mention it, *pData isn't even an array, is that bad?The actual Lock call itself is what fails. To be more specific -m_pPlanetIB0x00000006IDirect3DIndexBuffer9 *Direct3DResource9{...}IDirect3DResource9IUnknown{lpVtbl=??? }IUnknownlpVtblCXX0017: Error: symbol "" not foundit says symbol not found, but I dont know what it means.Declaration : short *pdata;Also, there is actually 3 functions in the call stack (in my code), does that mean all 3 are pertinent to the problem?   ;  Your function call is genuine and should work (your declaration of pData is fine).  I'd suspect m_pPlanetIB more than anything else.  Isn't it null?   ;  Sounds like your Index Buffer's Create call is failing. When that happens, the pointer you get back from Create is set to NULL. Make sure you handle a failure of the create method correctly.   ;  I don't understand what exactly you mean by null. It was working one frame and for no apparent reason it gives me an error the next, it appears to be completely random.The create call could could not have failed, because the IB was being used for a while before it failed.   ;  NULL means 0 (zero, zed) and indicates that the index buffer was not successfully locked.Quote:*pData isn't even an array, is that bad?No. If shouldn't be an array. Just a pointer.Quote:The create call could not have failedMaybe not the first time. What about the second time? Never make assumptions.You should ALWAYS (yes, I'm shouting) check return codes from DirectX function calls by either using the FAILED or SUCCEEDED macros, or checking the return code yourself.You should have something likeif( FAILED(vertexBuffer->LockIndexBuffer(<flags>,(LPVOID*)&m_pPlanetIB)) ) {   MessageBox(NULL,"Locking the index buffer failed!","Error!",MB_OK);   return;}// use the index buffer here...// done with the index buffervertexBuffer->UnlockIndexBuffer(); // you DO unlock it, right??;  If you're not changing m_pPlanetIB between where it works and fails directly what you need is a data breakpoint to track down the code that is changing it.   