Archived

This topic is now archived and is closed to further replies.

Cypher19

E_FAIL when running D3DXCreateEffectFromFile?

Recommended Posts

Okay, I''m doing a D3DXCreateEffectFromFile call, and for some reason it''s return E_FAIL as a result. Now, the E_FAIL is a problem, but more troubling is that the DX9 SDK has no documentation on what to do when the error IS E_FAIL: If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL The method call is invalid. For example, a method''s parameter may have an invalid value. D3DXERR_INVALIDDATA The data is invalid. E_OUTOFMEMORY Microsoft® Direct3D® could not allocate sufficient memory to complete the call. Does anyone know what might be causing this? (Btw, I''ve checked every parameter, and they''re all fine)

Share this post


Link to post
Share on other sites
This code might help:
{
ID3DXBuffer * pErrorMsgs;
hr = D3DXCreateEffectFromFile( m_pD3dDevice, "res/patch.fxo", NULL, NULL, 0, NULL, &m_pEffect, &pErrorMsgs );
if ( FAILED( hr ) && pErrorMsgs != 0 && pErrorMsgs->GetBufferPointer() != 0 )
{
#if defined( _DEBUG )
OutputDebugString( (char *)pErrorMsgs->GetBufferPointer() );
#endif // defined( _DEBUG )
}
}

Share this post


Link to post
Share on other sites
Oh, there''ll be some stuff dumped to the error messages I can check out? Okay, I''ll try that tomorrow morning! Thanks.

Share this post


Link to post
Share on other sites