• Advertisement
Sign in to follow this  

Help needed on instantiate abstract class(ID3DXAllocateHierarchy)

This topic is 4011 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 all, the following class came from a tut and when I use it I keep getting the error cannot instantiate abstract class. could some one show me what the class needs to be able to use it like this CMeshHeirarchy Mh;//this is what I need to be able to do class CMeshHeirarchy : public ID3DXAllocateHierarchy { public: // The format of these interfaces is defined by D3DXLoadMeshHierarchyFromX // callback to create a D3DXFRAME derived object and initialize it STDMETHOD( CreateFrame )( THIS_ LPCSTR Name, LPD3DXFRAME *ppNewFrame ); // callback to create a D3DXMESHCONTAINER derived object and initialise it STDMETHOD( CreateMeshContainer )( THIS_ LPCSTR Name, CONST D3DXMESHDATA * pMeshData, CONST D3DXMATERIAL * pMaterials, CONST D3DXEFFECTINSTANCE * pEffectInstances, DWORD NumMaterials, CONST DWORD * pAdjacency, LPD3DXSKININFO pSkinInfo, LPD3DXMESHCONTAINER * ppNewMeshContainer ); // callback to release a D3DXFRAME derived object STDMETHOD( DestroyFrame )( THIS_ LPD3DXFRAME pFrameToFree ); // callback to release a D3DXMESHCONTAINER derived object STDMETHOD( DestroyMeshContainer )( THIS_ LPD3DXMESHCONTAINER pMeshContainerToFree ); };

Share this post


Link to post
Share on other sites
Advertisement
The error message will tell you what functions are missing. For a start you're missing the IUnknown methods AddRef(), Release() and QueryInterface().

Why are you doing this anyway? Is it to intercept the mesh calls?

Share this post


Link to post
Share on other sites
Yes Im doing this so I can load in mesh and other things in One Big .X file file.
I found the error the tut that had the class def. one of the function prototypes was wrong so it was saying it was still a abstract class dame this took 3 hours to find how dumb am I.
thanks anyway

Share this post


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

  • Advertisement