PDA

View Full Version : problem with LoadMeshFromX and its error message



FlyingFish
06-10-2003, 02:43 PM
Hi guys,

I have a problem that looks very strange to me:
In my program I want to load a .x-File


if failed(D3DXLoadMeshFromX(pChar(FileName), D3DXMESH_SYSTEMMEM,
scene.D3DDEV8, Adjacency, D3DXMtrlBuffer,
NumMaterials, Mesh)) then begin ShowMessage('Oh shit!'); exit; end;

But the function fails (so the message is showed). As I understood DX, in HRESULT of the function should be displayed the error message. but HRESULT is empty. no message like invalidcall or outofmemory...

Can somebody help me with that? The program compiles normally and without the error message I don't know how to fix my problem.

Sven

Clootie
07-10-2003, 05:53 PM
So, what is the value of function result?
Try something like this:
[background=#FFFFFF][normal=#000000][number=#0000FF][string=#0000FF][comment=#248F24][reserved=#000000]uses ..., dxerr8;
...
hr:= D3DXLoadMeshFromX(...);
if FAILED(hr) then
begin
ShowMessage(Format('Oh shit!'#10'Error code is: %x'#10'Error description is: %s', [hr, DXGetErrorString8(hr)]));
end;

FlyingFish
08-10-2003, 01:26 PM
Well that was the problem, I made it like you said before, but there was no error message. function result was empty.

But I already found my mistake. A very dumb one: I forgot to put the .x-file in the right folder..... I'm a really big idiot..
So, the problem is solved now. everythings runs as it should.

sven