PDA

View Full Version : Parsing .x files : conversion problem ...



Avatar
15-07-2003, 07:17 AM
Hi all !

I was trying to create a little algorithm in order to parse .x files.

So I used the .x file structures(IdirectXfileObject, etc ...) but I got a problem when attempting to get the data.

Just look at that line of code in C++ :

"pData->GetName(pName, &dwSize);"

I had some problems to translate it to Delphi...

pData is a IDirectXFileData
pName if a PCHAR
and dwSize if a DWORD

So ... Chat would be the delphi translation ?
I tried this :

pData.GetName(pName, @dwSize);

But I get bad result ...

Can someone help me ?

Thx a lot :)

Bye
Avatar

ps : Sorry if I made any mistake in my sentences :)

Clootie
15-07-2003, 08:23 AM
[background=#FFFFFF][normal=#000000][number=#0000FF][string=#0000FF][comment=#248F24][reserved=#000000]var
pXofChildData: IDirectXFileData;
name: array[0..255] of Char;
nameLen: DWORD;
begin
...
nameLen:= SizeOf(name);
pXofChildData.GetName(@name, nameLen);
...
end;

This is implemented in: http://clootie.narod.ru/delphi/download_custom.html#D3Dex_MeshHierarchy

Avatar
15-07-2003, 09:19 AM
That's right, just found it, but there's still a problem ...

pXofChildData.GetName(@name, nameLen);

doesn't work ... I had to type :

pXofChildData.GetName(@name, @nameLen);

Perhaps it's because I'm using DX8.1 and not DX9

Anyway thanks a lot !

bye
Avatar