D3DXCompileShaderFromResource doubt

I want to use this D3DXCompileShaderFromResource API to compile my HLSL shaders. Somebody plz tell me how to add a shader as a resource inside VS2005. When i tried it shader compilation fails saying resource not available..plzzz help am stuck
[242 byte] By [vinoods] at [2007-12-23]
# 1
Hi,

Do the following steps:

1) Make a .txt file with shader (Shader.hlsl for example);
2) Add the resource to your projects using the button 'Import...' (to show your file choose 'all files' as file types in the dialog box that appears).
3) When the IDE prompt for the Resource Type, it's fundamental that you insert the string 'RCDATA' (i.e. a binary resource).
4) Then to compile your shader use the following code:

LPD3DXCONSTANTTABLE m_pTexture_ConstantTable = NULL; LPD3DXBUFFER l_pShader = NULL;

HRESULT hr = D3DXCompileShaderFromResource(
NULL,
MAKEINTRESOURCE(IDR_RCDATA1),
NULL, // CONST D3DXMACRO* pDefines,
NULL, // LPD3DXINCLUDE pInclude,
"main",
"vs_1_1",
0,
&l_pShader,
NULL, // error messages
&m_pTexture_ConstantTable );

Supposing that your created resource have the name IDR_RCDATA1.

Unfortunately the fact that is necessary to use RCDATA as resource type is not documented in the 'D3DXCompileShaderFromResource' topic of DirectX help, but only in D3DXCreateEffectFromResource (better if Microsoft insert this fact as remark in the others resource related functions).

Hope this help,

- AGPX

AGPX at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...