   DirectX Issue - Runtime crash when drawing begins
  Hi,I've been trying to put together a DX 9 framework over the last week or so in an attempt to re-fresh my memory with using it. Unfortunatly I've seem to have forgotten more than I still remember [oh].The code compiles with no errors, but during runtime I get a crash at the start of the draw loop:-m_cDraw->m_FX->Begin(numPasses, 0); //Crashes herem_cDraw->updateFX(m_matActor, *matWorld, *matView, *matProj);m_cDraw->m_FX->BeginPass(0);m_cActorPrim->DrawTri(gd3dDevice);m_cDraw->m_FX->EndPass();m_cDraw is an instance of the effect class. At the time of crash the handles to the technique and the WVP matrix in the shader are bad pointers. So I back tracked to where they initially get set and found that they never actually get set. //Obtaining handle to an effectmhTech = m_FX ->GetTechniqueByName("TransformTech");mhWVP = m_FX->GetParameterByName(0, "gWVP");The method is called, the code is exectued, but they remain bad pointers and I'm not sure why this is. Can anyone help? I'll post more code if its needed.   
  What do the Debug Runtimes say? Are you checking all of your return values?   ;  The debug runtime crash says:- "Unhandled exception at 0x009f3331 in DXFlockingSteering.exe: 0xC0000005: Access violation reading location 0xfeeefef2."When I look at the values at the time of crash they just say bad pointer. All the other return values seem to be correct, at least there not bad pointers.   ;  I know its rude to bump your own threads, but I'm still stuck and would really appreciate any suggestions at all   ;Quote:Original post by ScottH87I know its rude to bump your own threads, but I'm still stuck and would really appreciate any suggestions at allLook at the link Steve posted - he is not referring to the message box that appears when your application crashes, but to the debug spew that VS captures when you have the debug runtime enabled.This is separate from compiling your application in release or debug mode and needs to be set from the DX control panel, as per the information in Steve's link.Hopefully this may give a clue as to what is causing the problem. There certainly isn't enough information in your original post for us to be able to tell.   ;  The Address near 0xfeeefeee indicates you're accessing a deleted object pointer.   ;Quote:Original post by EndurionThe Address near 0xfeeefeee indicates you're accessing a deleted object pointer.Indeed. To expand on that a little - you're using an interface you've Release()d already. Either m_cDraw or m_FX has been released.You should be setting all your interfaces to null after releasing them, which will make problems like that more easily detectable.The output from the debug runtimes will tell you if something is failing, which you can use to follow your code and see what's going wrong. It's worth noting that you should be prepared for any single D3D call failing, but especially those which create interfaces or supply other data you rely on (Such as GetDeviceCaps()).   