   D3DXCreateTextureFromFileInMemory
  Hello,Could somebody say me what's wrong in this program.The goal is to put a GDI text in a texture.HDC HdcTxtOut;HFONT hfnt, hOldFont; DWORD Size;HBITMAP HdcBmpTxtOut;BITMAP BitMapInfoStr;HRESULT TextureCreate;hfnt = (HFONT)GetStockObject(ANSI_VAR_FONT); HdcTxtOut = CreateCompatibleDC(hDC);hOldFont = (HFONT)SelectObject(HdcTxtOut, hfnt);HdcBmpTxtOut = CreateCompatibleBitmap(HdcTxtOut,Width, Hight);SelectObject ( HdcTxtOut, HdcBmpTxtOut );Size = GetTabbedTextExtent(HdcTxtOut,L"Youpi ! Youpi !",-1,0,NULL);int Width,Hight;Width = (int)(Size & 0x0000FFFF);Hight = (Size >> 16) & 0x0000FFFF ;int ret1 = TextOut(HdcTxtOut,0, 0,L"Youpi ! Youpi !", 15);int ret2 = GetObject(HdcBmpTxtOut,sizeof(BITMAP),&BitMapInfoStr);TextureCreate = D3DXCreateTextureFromFileInMemory(pd3dDevice,&BitMapInfoStr,Width * Hight,&ppTexture);The TextureCreate returned value is 0x88760b59 (invalid argument)   
  That function loads a complete file in memory, not a GDI bitmap.  Plus creating a texture every time you wrote text would be pretty inefficient.   Just create the bitmap and the texture once, then every time you need to render text just write the text to the bitmap and lock the texture so you can copy the bitmap's pixel data into the texture.Also I'm not sure if you're aware, but this is exactly how ID3DXFont works.   ;  Thank's for your reply.The reason why i want put the text in a bitmap and then in a texture is that after  these 2 operations i want to move a collection of so builded texture from the right to the left of the screen. This move should be 10 pixels left for each texture every 40 ms with the minimun CPU time.To do that, i was thinking that this method is the more efficient. Did you agree ?