• Advertisement
Sign in to follow this  

problem with D3DXCreateEffectFromFile

This topic is 4925 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have problem with D3DXCreateEffectFromFile. I have: (...) #include <d3d8.h> #include <d3dx8.h> (etc.) hResult = D3DXCreateEffectFromFile( p_D3DDevice, "sun.fx", &g_lpEffect, &buffer ); When I try compile it, there is error: C2664: 'D3DXCreateEffectFromFileW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR' I've tried (LPCWSTR)"sun.fx". My program has compiled, but it hasn't worked (brake down with hResult = E_Fail) Error: Unhandled exception at 0x004cbfdc in dxframework.exe: 0xC0000005: Access violation reading location 0xcdcdcdcd. buffer returns: sun.fx(1) : syntax error

Share this post


Link to post
Share on other sites
Advertisement
hi try setting your .vcproj to 'Use Multi-Byte Character Set' in the General section. That way you can use const char* arguments.

Share this post


Link to post
Share on other sites
ok. I can use:
hResult = D3DXCreateEffectFromFile( C_View::p_D3DDevice, "sun.fx", &g_lpEffect, &lpError );
But hResult still equals E_Fault and lpError returns:
sun.fx(1) : syntax error

Share this post


Link to post
Share on other sites
post your shader code so one of us can see why your .fx file isn't compiling. sounds like line 1 in .fx file is using the wrong syntax. Can;t recall if I've gotten that same exact error but maybe some bells will ring if i see the source.

Btw, you're using DX8? I don't know anything bout that version. I use the dx9 summer sdk. I thought HLSL didn't exist in dx8?

[Edited by - vajuras on October 24, 2004 8:40:56 PM]

Share this post


Link to post
Share on other sites
I think you should use DX9, dx8 hasn't all functions for the hlsl...
If you want to see if your shader works, try to compile it with FXcomposer (from nvidia), so you can see the error directly in the program.
About this error:
C2664: 'D3DXCreateEffectFromFileW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR'

Write it so:
hResult = D3DXCreateEffectFromFile( p_D3DDevice, L"sun.fx", &g_lpEffect, &buffer );

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement