Sign in to follow this  
thanhquoc_uit

D3DXLoadSkinMeshFromXof, Access violation reading

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
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

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