Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. help me to find errors! Thanks

help me to find errors! Thanks

Scheduled Pinned Locked Moved C / C++ / MFC
helpdebuggingquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Guoguor
    wrote on last edited by
    #1

    Hello everyone, An error occur when I debug the follow codes,please help me tofind the errors,Thanks! DDSURFACEDESC2 ddsd; LPDIRECTDRAWSURFACE4 g_pDDSBack = NULL; //DirectDraw back surface HRESULT hRet; memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags= DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_BACKBUFFERCOUNT; ddsd.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOPORT | DDSCAPS_SYSTEMMEMORY| //DDSCAPS_VIDEOMEMORY | DDSCAPS_FLIP | DDSCAPS_BACKBUFFER | DDSCAPS_COMPLEX| FALSE; ddsd.dwBackBufferCount = 1; ddsd.dwWidth =g_SurfWidth; ddsd.dwHeight =g_SurfHeight*g_Factor; ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC; ddsd.ddpfPixelFormat.dwFourCC=mmioFOURCC ('Y','U','Y','V'); Line1: hRet = g_pDD->CreateSurface(&ddsd, &g_pDDSBack, NULL); Note : g_pDD is a created LPDIRECTDRAW4 vairable Add I have checked the value of g_pDD. It's not zero! g_SurfWidth,g_SurfHeight,g_Factor are all initialzed! but When I excute the program g_pDDSback is zero! why? Is there some errors at the setting of ddsd? free like a bird

    D 1 Reply Last reply
    0
    • G Guoguor

      Hello everyone, An error occur when I debug the follow codes,please help me tofind the errors,Thanks! DDSURFACEDESC2 ddsd; LPDIRECTDRAWSURFACE4 g_pDDSBack = NULL; //DirectDraw back surface HRESULT hRet; memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags= DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_BACKBUFFERCOUNT; ddsd.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOPORT | DDSCAPS_SYSTEMMEMORY| //DDSCAPS_VIDEOMEMORY | DDSCAPS_FLIP | DDSCAPS_BACKBUFFER | DDSCAPS_COMPLEX| FALSE; ddsd.dwBackBufferCount = 1; ddsd.dwWidth =g_SurfWidth; ddsd.dwHeight =g_SurfHeight*g_Factor; ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC; ddsd.ddpfPixelFormat.dwFourCC=mmioFOURCC ('Y','U','Y','V'); Line1: hRet = g_pDD->CreateSurface(&ddsd, &g_pDDSBack, NULL); Note : g_pDD is a created LPDIRECTDRAW4 vairable Add I have checked the value of g_pDD. It's not zero! g_SurfWidth,g_SurfHeight,g_Factor are all initialzed! but When I excute the program g_pDDSback is zero! why? Is there some errors at the setting of ddsd? free like a bird

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      You've not told us what this code snippet is doing. What value does hRet have after calling CreateSurface()?


      "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

      G 1 Reply Last reply
      0
      • D David Crow

        You've not told us what this code snippet is doing. What value does hRet have after calling CreateSurface()?


        "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

        G Offline
        G Offline
        Guoguor
        wrote on last edited by
        #3

        Sorry!I forget! After calling CreateSurface() hRet=DDERR_NOOVERLAYHW; Is that means display doesn't support overlay surface? Thanks! free like a bird!

        D 1 Reply Last reply
        0
        • G Guoguor

          Sorry!I forget! After calling CreateSurface() hRet=DDERR_NOOVERLAYHW; Is that means display doesn't support overlay surface? Thanks! free like a bird!

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Guoguor wrote: Is that means display doesn't support overlay surface? Correct, no overlay hardware is present or available.


          "Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups