locked
D3D9Overlay Exception from d3d9.dll during PresentEx RRS feed

  • Question

  • Hi,

    I am encountering an issue while minimizing my D3D9Overlay application. Minimizing the application and calling PresentEx results in exception from d3d9.dll with "divide by zero error" in debugger.  What is the correct way to handle app minimize with D3D9Overlay presentation - should I simply stop presenting when app is minimized?

    Thanks for your help.
    Ahmad
    Thursday, September 10, 2009 10:47 PM

Answers

  • For pausing in MFC, on my mainframe window:

      afx_msg void OnActivateApp(BOOL bActive, DWORD  hTask);

    And in it use:

    CWnd::IsIconic() to tell if it is minimized.

    How you do this will depend on the windowing framework you are using.

    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    • Marked as answer by ahmadR Saturday, September 12, 2009 7:29 AM
    Friday, September 11, 2009 4:03 AM

All replies

  • Are you talking about this in the WLK:


    Or, this in MF:


    If the latter, I would expect it is an error to call PresentEx while your video output window is minimized.  Why would you want to do this since it will take CPU/GPU resources?



    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    Thursday, September 10, 2009 11:24 PM
  • Both the links refer to D3D9Overlay as far as I can see. 

    >  would expect it is an error to call PresentEx while your video output window is minimized.  
    There is no such indication in the documentation either for an overlay or non-overlay device. It obviously succeeds for a non-D3D9Overlay device.

    > Why would you want to do this since it will take CPU/GPU resources?
    Because I am too lazy to code, but in any case I wont consider it an error unless indicated so by Microsoft.  

    Thanks,
    Ahmad
    Friday, September 11, 2009 1:12 AM
  • One is a test in the WLK and the other refers to how to use the overlay in MF.  I found the former first when I searched for the terms in your post.

    You can use the feedback tool on the MSDN page to say it needs clarification for what to do in the minimized window case.  My take, however, is that you should pause your video when it is minimized.  That is what I do in my app.

    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    Friday, September 11, 2009 1:45 AM
  • Thanks for looking into it. I will use the feedback tool on the MSDN page also, just hoping maybe someone from MS might respond to this post.

    Regarding pausing the video when minimized, I think I may have to look for the WM_WINDOWPOSCHANGING and determine minimize by final yPos <= 0? Is this the way how one should determine if window is being minimized?

    Thanks,
    Ahmad
    Friday, September 11, 2009 3:54 AM
  • For pausing in MFC, on my mainframe window:

      afx_msg void OnActivateApp(BOOL bActive, DWORD  hTask);

    And in it use:

    CWnd::IsIconic() to tell if it is minimized.

    How you do this will depend on the windowing framework you are using.

    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    • Marked as answer by ahmadR Saturday, September 12, 2009 7:29 AM
    Friday, September 11, 2009 4:03 AM
  • There is an IsIconic() function in Win32 also and it works perfectly. Thanks
    Saturday, September 12, 2009 7:29 AM
  • Great!  Thanks for following up.  I will send a note to a contact at MSFT about the exception you were seeing.  Maybe the minimize case isn't tested as part of the WLK certification I linked to above.
    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    Sunday, September 13, 2009 3:43 PM