Magnification API - Sometimes an error occur when the MagSetWindowSource function called


  •  I am developing a capture application with Magnification API. The program is to capture of both primary and Seconday Screen. Sometimes access violation occur when MagSetWindowSource function called.

    1.  The error is 

    First-chance exception at 0x7fefeb257c9 in test01.exe: 0xC0000005: Access violation reading location 0x0afff660.

    2. My Developing Environment is

    OS : windows 7 64bits

    Video : NVIDIA Geforce GT 520 , Dual Monitor(Primary 1280x1024, Secondary 1920x1080)

    Application : 32bit application.

    3. My test code is

    if (!MagSetWindowFilterList(hwndMag, MW_FILTERMODE_EXCLUDE, 1, pFilterList))

    {  return;


    RECT sourceRect; = 0;

    sourceRect.left = m_ScreenX;

    sourceRect.right = m_ScreenX + m_ScreenW;

    sourceRect.bottom = m_ScreenH;//m_ScreenY;

    if (!MagSetWindowSource(hwndMag, sourceRect)) // Access violation frequently.  The value of sourceRect is valid.




    //The reference of this source is

    Please help me. I'dont know why error occur sometimes.

    Thank for reading it.

    Monday, August 12, 2013 7:19 AM

All replies

  • I had a lot of test. This problem is dependent on Video Card.
    However, there hasn't been an exact method to solve the problem.
    I solved like this. Do capture the screen on half size and merge two capture data.
    Wednesday, August 21, 2013 5:20 AM
  • I also have same problem. in my case, the error occurs after changing screen resolution.

    Any ideas how to fix it?

    Tuesday, January 13, 2015 10:19 PM