Jump to content
  • Advertisement
Sign in to follow this  
thanhquoc_uit

D3DXLoadSkinMeshFromXof, Access violation reading

This topic is 3471 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

Hi, I'm very new, I have problem with D3DXLoadSkinMeshFromXof function, I use SDK Dec, 2005. And i don't know what Access violation reading here. LPD3DXMESH ppMesh = NULL; ... bool ParseObject(ID3DXFileData* pDataObj, ID3DXFileData* pParentDataObj, DWORD depth, void** data, bool reference) { GUID type; pDataObj->GetType(&type); if(reference == true) return true; if(type == TID_D3DRMMesh) { if(D3DXLoadSkinMeshFromXof(pDataObj, D3DXMESH_SYSTEMMEM, md3dDevice, NULL, NULL, NULL, NULL, NULL, &ppMesh) == D3D_OK) // problem here ... } return ParseChildObject(pDataObj, depth, data, reference); } Unhandled exception at 0x005611a5 in SkinnedMeshDemo.exe: 0xC0000005: Access violation reading location 0x00000000. And I'm linking to d3dx9d.lib. Someone can help me solve the problem! Thanks

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by thanhquoc_uit
Hi,
I'm very new, I have problem with D3DXLoadSkinMeshFromXof function, I use SDK Dec, 2005. And i don't know what Access violation reading here.

LPD3DXMESH ppMesh = NULL;
...
bool ParseObject(ID3DXFileData* pDataObj, ID3DXFileData* pParentDataObj, DWORD depth, void** data, bool reference)
{
GUID type;
pDataObj->GetType(&type);
if(reference == true)
return true;

if(type == TID_D3DRMMesh)
{
if(D3DXLoadSkinMeshFromXof(pDataObj, D3DXMESH_SYSTEMMEM, md3dDevice, NULL, NULL, NULL, NULL, NULL, &ppMesh) == D3D_OK) // problem here
...
}
return ParseChildObject(pDataObj, depth, data, reference);
}

Unhandled exception at 0x005611a5 in SkinnedMeshDemo.exe: 0xC0000005: Access violation reading location 0x00000000.

And I'm linking to d3dx9d.lib.

Someone can help me solve the problem!
Thanks
Either your pDataObj or md3dDevice pointers are null.

As an aside, you should never test against D3D_OK like that - that only checks 1 of the 2 billion success codes. Use the SUCCEEDED() or FAILED() macro instead.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Either your pDataObj or md3dDevice pointers are null.

Thanks Evil Steve!
pDataObj and md3dDevice pointers are still valid
I have checked all, all okay!
I wonder there is something wrong inside D3DXLoadSkinMeshFromXof function with SDK Dec, 2005?

Share this post


Link to post
Share on other sites
Then I'd guess that one or more of those NULL pointers you're passing in needs to be valid. The access violation basically means "The CPU tried to read from address 0x00000000, which is invalid" which means you have a null pointer that shouldn't be.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!