Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / Compilation problems Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
BurningCircuit

May 19, 2005, 01:56 AM


Many DirectX projects bring up errors when I try and compile them,
the errors seem to be of this form or similar:

"c:AdvAniBookCodeBookCodeCommonDirect3D.cpp(314) : error C2664: 'D3DXLoadSkinMeshFromXof' : cannot convert parameter 1 from 'IDirectXFileData *' to 'LPD3DXFILEDATA'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast"

i.e. for some reason the compiler recognises these pointers as being
of different types.

I'm using Windows XP, DirectX 9 and MS Visual Studio .NET 2003.
These errors did not occur when I was using MS Visual C++ v6.
I'd be grateful for any input on how to fix this.

BC.


 
tokjunior

May 19, 2005, 01:58 AM

Simple. Don't declare your vars as being of IDirectX, but as LPDIRECTX.

 
tokjunior

May 19, 2005, 01:59 AM

Oh. And the reason for failure is that VC++.NET is a bit stricter.

 
BurningCircuit

May 19, 2005, 03:14 AM

Thanks, I'll give it a go.

 
Erik Faye-Lund

May 19, 2005, 05:28 AM

uhm, i allways use the com-interfaces directly, in msvc.net 2k3. i never had any issues like that.

 
juhnu

May 19, 2005, 06:51 AM

LP prefix is just a useless typedef for a pointer type. I strongly recommend you to use types directly and not thru obfuscated typepefs as it seems they're doing nothing but confusing you. There's no compiler magic or anything related to the LP-prefixed typedefs. LPxxx means a pointer to Ixxx-interface, nothing more, nothing less and you dont really need to use them at all.

as the compiler says the 'IDirectXFileData *' and 'LPD3DXFILEDATA' are unrelated types. 'LPD3DXFILEDATA' stands for 'ID3DXFileData*' and that is not same as IDirectXFileData. If you look at the documentation, you can check yourself that the interfaces are different and not related.

The reason it might have worked earlier must be due to the directx version, not because of the compiler.


juhani

 
Erik Faye-Lund

May 19, 2005, 06:56 AM

oh, i didn't see the difference between IDirectXFileData* and ID3DXFileData* :P

 
This thread contains 7 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.