Error loading an x-file

Started by
4 comments, last by VincentLascaux 22 years, 9 months ago
Hi, I get the error DXFILEERROR_PARSEERROR, trying to read an x-file HRESULT LoadFromXFile(char* FileName) { HRESULT hr; IDirectXFile* File; DirectXFileCreate(&File); IDirectXFileEnumObject* Enum; if(FAILED(hr=File->CreateEnumObject(FileName,DXFILELOAD_FROMFILE,&Enum))) return hr; IDirectXFileData* Data=NULL; while(!FAILED(hr=Enum->GetNextDataObject(&Data))) /* I get the error here, from the GetNextDataObject function */ { // Work with Data here } if(hr!=DXFILEERR_NOMOREOBJECTS) return hr; Enum->Release(); File->Release(); return S_OK; } Do you have any idea of the meaning of this error, and what I do wrong ? Thanks
Advertisement
Just an idea: did you try it with different x-files? Maybe the one you used is corrupt.
As far as I know, some 3d modeller don''t export the modells created properly.
Maybe you should try an x-file that came with the sdk.
Funny remarque ! I just thought about it sending my original post. I told me : "Hey, maybe the cube you exported is corrupted !". So I tried a x-file from the SDK and I still have the same boring error...

Hum... English is not my native language ; when you say "parse", you mean "read", dont you ?
well, parse actually means something like ''analyze''. but don''t ask me what the functions parses.
It sounds as if the templates are not registered. They need to be included in the .X file or add a call to IDirectXFile::RegisterTemplates with the standard real-mode templates (check the SDK example for exact lines).



Jim Adams
home.att.net/~rpgbook
Programming Role-Playing Games with DirectX 8
Yes, that was the templates. I had the line and it works. Great, thank you

This topic is closed to new replies.

Advertisement