Sign in to follow this  
ankhd

Help needed on instantiate abstract class(ID3DXAllocateHierarchy)

Recommended Posts

ankhd    2304
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
Evil Steve    2017
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
ankhd    2304
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

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