they are not compatible which gave me some runtime errors..
Not too surprising. You can't cast an apple as an orange and hope the juicer will somehow make orange juice.
Take a look at the docs. It appears you need to use (a pointer to ) ID3DXFileData (not IDirectXFileData) as your input object. Unless you have a ten year old SDK installed, the API you're using today isn't the same one that Adam's assumes (assuming you're talking about Adam's 2003 book).