   adding tangents to a model
  ive loaded a model from an .x file to a LPD3DXMESH using "d3dMesh.h"... however the mesh doesnt have tangents... which  could add with the "SetVertexDecl" function... but i have to change the vertex declaration for that...how would i add an entry at the end of the vertex declaration without changing the others?   
  This is the general procedure I use for the rare occasion where I load .X meshes, its basically taken straight from the SDK samples:-Load the mesh from the .X file-Check the vertex declaration from the mesh, see if it contains normals/tangents/binormals-If they're not there, create a new vertex declaration containing all of those things-Clone the mesh with the new vertex declaration (using ID3DXBaseMesh::CloneMesh)-If necessary, use D3DXComputeNormals to compute the normals-If necessary, use D3DXComputeTangentFrame or D3DXComputeTangentFrameEx to compute the tangents and binormals-Make sure to release the old meshI don't remember which sample exactly used this process...I think it was the ParallaxOcclusionMapping sample.As for adding entries to the old declaration, I would suppose you would loop through the old declaration and copy the entries to your new declaration until you got to the end.  Then, you could add an entry to the new declaration at the next index with the Offset set according to the last entry in the old declaration.   