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. how to get IDirectNotify

how to get IDirectNotify

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
3 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.
  • L Offline
    L Offline
    laia
    wrote on last edited by
    #1

    i am working with a directsound program. i need IDirectNotify to place some notification when playing sound. but i found that i can't get it through the function-QueryInterface. it always fails. please help me. thanks laia.

    A 1 Reply Last reply
    0
    • L laia

      i am working with a directsound program. i need IDirectNotify to place some notification when playing sound. but i found that i can't get it through the function-QueryInterface. it always fails. please help me. thanks laia.

      A Offline
      A Offline
      Alexander M
      wrote on last edited by
      #2

      HRESULT SetStopNotification(HANDLE hMyEvent,
      LPDIRECTSOUNDBUFFER8 lpDsbSecondary)
      {
      LPDIRECTSOUNDNOTIFY8 lpDsNotify;
      DSBPOSITIONNOTIFY PositionNotify;
      HRESULT hr;

      if (SUCCEEDED(
      hr = lpDsbSecondary->QueryInterface(IID_IDirectSoundNotify8,
      (LPVOID*)&lpDsNotify)))
      {
      PositionNotify.dwOffset = DSBPN_OFFSETSTOP;
      PositionNotify.hEventNotify = hMyEvent;
      hr = lpDsNotify->SetNotificationPositions(1, &PositionNotify);
      lpDsNotify->Release();
      }
      return hr;
      }

      Don't try it, just do it! ;-)

      L 1 Reply Last reply
      0
      • A Alexander M

        HRESULT SetStopNotification(HANDLE hMyEvent,
        LPDIRECTSOUNDBUFFER8 lpDsbSecondary)
        {
        LPDIRECTSOUNDNOTIFY8 lpDsNotify;
        DSBPOSITIONNOTIFY PositionNotify;
        HRESULT hr;

        if (SUCCEEDED(
        hr = lpDsbSecondary->QueryInterface(IID_IDirectSoundNotify8,
        (LPVOID*)&lpDsNotify)))
        {
        PositionNotify.dwOffset = DSBPN_OFFSETSTOP;
        PositionNotify.hEventNotify = hMyEvent;
        hr = lpDsNotify->SetNotificationPositions(1, &PositionNotify);
        lpDsNotify->Release();
        }
        return hr;
        }

        Don't try it, just do it! ;-)

        L Offline
        L Offline
        laia
        wrote on last edited by
        #3

        I just use these codes to get it, but the QueryInterface always failed. Then I try to get the interface to the CaptureBuffer, it is ok. Why these happened? laia

        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