   After creating the surface, why ddsd.dwWidth is zero?
BOOL CGame::DDInitialize(){HRESULT hr;hr = DirectDrawCreateEx(NULL, (void**)&m_lpDD, IID_IDirectDraw7, NULL);if ( FAILED(hr) )return FALSE;hr = m_lpDD->SetCooperativeLevel(m_hWnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);if ( FAILED(hr) )return FALSE;hr = m_lpDD->SetDisplayMode(m_iScreenWidth, m_iScreenHeight, m_iBip, 0, DDSDM_STANDARDVGAMODE);if ( FAILED(hr) )return FALSE;memset(&m_ddsd, 0, sizeof(DDSURFACEDESC2));m_ddsd.dwSize = sizeof(m_ddsd);m_ddsd.dwFlags = DDSD_CAPS| DDSD_BACKBUFFERCOUNT;m_ddsd.dwBackBufferCount = 1;m_ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP;;hr = m_lpDD->CreateSurface(&m_ddsd, &m_lpDDSPrimary, NULL);if ( FAILED(hr) )return FALSE;//Here!!!!!!!!!!!!!!!!//I output the m_ddsd.dwWidth, but it is Zero!!!Why not equal m_iScreenWidth?DebugOutInt( "width", m_ddsd.dwWidth );m_ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;if ( FAILED(m_lpDDSPrimary->GetAttachedSurface(&m_ddsd.ddsCaps, &m_lpDDSBack)) )return FALSE;//............
  I had fix it!I forgot to Lock the surface...   