   System.NullReferenceException Error?
  I just added a new mesh into my app, which has always run 100% well before. For some odd reason now though the new mesh is throwing a System.NullReferenceException on the linem_NumVertices = m_pMesh->GetNumVertices();I know it seems like the m_pMesh is NULL, so I checked that, and it's not, and if I comment out this line the mesh renders (RenderSubset) just fine. Since I can't interpret these error messages worth a damn I'll just post screenshots.Thanks for any advice![edited by - ms291052 on December 18, 2003 10:34:58 PM]
  That exception looks like a failure in a string copy operation, done where you''re building some weapon''s data or somesuch.  I wonder if it''s usually just blasting memory that doesn''t happen to get touched unless you call that method.  ??  Seems odd to me.   I like pie. ;  Now the same is coming up in other places that have always worked... ;  Er... it just came up on the line LastTime = GetTickCount(); (LastTime is a static int) ;  What is on line 10 of initgeometry.cpp? The stack trace doesn''t seem to have anything to do with a GetNumVertices call.;  Oooohhh, i don''t know if this is relevent but line 10 of initgeometry is indeed the line where that mesh is initialized... however, now, even when I switch back to the previous one, it still throws all the errors... ;  Another note, just in case someone finds it significant: if I comment out the offending line, it then says the error is on the next line down. ;  It might help if we could see some code. Otherwise, we''re just grasping at straws.;  It looks like you''re maybe blowing your stack out with something.  Check the this pointers in the debugger when the exception is thrown, and other things.  Just look for memory corruptions.   I like pie. ;  Sure thing... what do you need? I''ll post what I think is relevant... if you need more, please ask!HRESULT InitGeometry(){g_Player = THING(g_pd3dDevice, "meshes//srobot.x", D3DXVECTOR3(0.0f, 2.44f, 10.0f), TT_ENTITY);g_Enemy = THING(g_pd3dDevice, "meshes//srobot.x", D3DXVECTOR3(0.0f, 0.0f, -10.0f), TT_ENTITY);//g_Room = THING(g_pd3dDevice, "levels//level1//level.x", D3DXVECTOR3(0.0f, 0.0f, 0.0f), TT_ROOM); //This is (was) line 10 in initgeometry.cpp...}and the THING class is fine, and the constructor is just THING(device, modelfilepath, position, thingtype) 