   vertex buffer
  if( FAILED( m_pd3dDevice->CreateVertexBuffer( 6*sizeof(CUSTOMVERTEX_M),   D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX_M,   D3DPOOL_DEFAULT, &m_pVB, NULL ) ) )    {DWORD a = GetLastError();    }CreateVertexBuffer fails and GestLastError returns 8Does somebody know what is wrong and how to fix it ? 
  what is 8? Include dxerr9.h and link to dxerr9.lib. Then doDXGetErrorString9( a );DXGetErrorDescrption( a );and check what they tell you.   :::: [ Triple Buffer ] ::::;  No they won''t.  GetLastError is checking what the last WINDOWS error is, not DirectX error.  He needs to save the HRESULT from his call, check if failed, and then call DXGetErrorString9 with the HRESULT. ;  i don''t know about 9, but in 8, the DXGetErrorString8 is worthless, as are the HRESULTs. i use them to generate an errors message from an exception, and they always basically just tell you it failed, with no reason why, which is what the debug runtimes do. they are infinitely more helpful, because nearly all fails just return INVALID_CALL. ;quote:Original post by spillsome  D3DFVF_CUSTOMVERTEX_M,&m_pVB Can we see the define statement for D3DFVF_CUSTOMVERTEX_M, the struct declaration for CUSTOMVERTEX_M and the line where you declare the variable m_pVB? ;  NatasDM.Here is the struct and the define statementstruct CUSTOMVERTEX_M{   FLOAT x, y, z;  // The vertex co-ordinates    FLOAT tu, tv;};#define D3DFVF_CUSTOMVERTEX_M (D3DFVF_XYZ|D3DFVF_TEX1)anybody? ;  I dont know if this answer has anything to do with this question, but anyway:From DX error lookupHRESULT: 0x00000008 (8)Name: ERROR_NOT_ENOUGH_MEMORYDescription: Not enough storage is available to process this command.Severity code: SuccessFacility Code: FACILITY_NULL (0)Error Code: 0x0008 (8)   ----- ;  1) Use the debug DirectX runtimes, increase the level slider in the DirectX control panel applet, run your code in the debugger (F5 in MSVC) and look at the debug output window afterwards. If a DirectX function returned an error code, the debug runtimes will EXPLAIN why that error was returned.2) As mentioned GetLastError() has nothing to do with DirectX. The failure code from all DirectX functions is the HRESULT they return. Try changing that to:HRESULT hr;if( FAILED( hr = m_pd3dDevice->CreateVertexBuffer( 6*sizeof(CUSTOMVERTEX_M), D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX_M, D3DPOOL_DEFAULT, &m_pVB, NULL ) ) ){  DWORD a = GetLastError();  HRESULT a = hr;}  3) Did I mention using the debug runtime?...   --Simon O'Connorex    -Creative AsylumProgrammer &Microsoft MVP [edited by - s1ca on August 4, 2003 5:32:49 PM]