Jump to content
  • Advertisement
Sign in to follow this  
daerom

D3DXLoadMeshHierarchyFromX causes access violation

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

Kinda wierd, but when debugging in VC++ 6 I get an access violation at the following line: D3DXLoadMeshHierarchyFromX(strFileName,D3DXMESH_MANAGED,m_D3DDevice,&tmpHierarchy,NULL,&m_RootFrame,&m_AnimController) But, the wierd part is, if I just run the compiled .exe, it works fine. Any thoughts?

Share this post


Link to post
Share on other sites
Advertisement
it probably doesn't work in the exe it just screws up silently, (ie. overwriting memory somewhere is shouldn't.)

As for the error itself I presume you have checked all the values your passing are initilized correctly?

Even if they are all right this is the line that took me the longest to fix of my entire project, (and the line was fine it was stuff leading up to it/used by it)

First if posible get a newer DirectX SDK that fixed it for me the first time this happend, (But summer 2004 doesn't support VC6...)

Also search these forums for D3DXLoadMeshHierarchy should find a few other people who had this problem.

Share this post


Link to post
Share on other sites
Thanks... I did a search on the forum for this error and came up with just 1 entry... the person had a similar problem, and it just required a THIS_ in the CAllocationHierarchy calls... which I've done as well, but to no avail. I have to admit, I am not the greatest at debugging, so I'm not totally certain everything is initialized correctly. I'm positive the strFileName is, the D3D Device is as well... I've tried an ASSERT on the RootFrame and AnimController, but nothing happened. If you could offer some advice I'd appreciate it.

oh.. and, I do have 2003 summer update installed... I tried reinstalling the DX9 SDK and installing the update, that didn't work either. So I assume it has to do with something I am passing being messed up.

Share this post


Link to post
Share on other sites
summer 2004 is most recent not 2003, (but it doesn't support vc6)

also are you using STDCALL? I needed it too the classes you have to implement are VERY picky

if you have a bad debuger alot of printf lines can do wonders, "got here", "%ld" for pointers "%d" for ints, "%f" for floats/doubles and for windows apps use fprintf, (to file)

Share this post


Link to post
Share on other sites
Thanks drdlord... I have VC6, so I didn't get the summer 2004. I do have the STDMETHOD defines in a header file that is included. I did use a lot of little messageboxs to find the line that was wrong... Is there a way I can see where it's blowing up within the DX Function? Like what specifically is causing the violation?

Share this post


Link to post
Share on other sites
not without a true debugger and even then it generaly doesn't help much as the directx libs are pre-compiled so all you can look at is assembler... but put in fprintf or msg boxes inside the CreateMeshContainer etc. functions, (I suggest fprintf as alot of frames are created) you want to know what one screws up and see what's different about it

This reminds me some of the frames in tiny.x have a name of null, not empty string if you don't know that it can cause this error.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!