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. Program execution hangs at accSelect.

Program execution hangs at accSelect.

Scheduled Pinned Locked Moved C / C++ / MFC
5 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.
  • K Offline
    K Offline
    kartikdasani
    wrote on last edited by
    #1

    I use the following lines of code in my program to get focus to a particular object and select it: hr = (SELFLAG_TAKEFOCUS,varTemp); hr = pTempAcc->accLocation(&left,&top,&width,&height,varTemp); The trouble is that after the my program has been running for a while ( as such there is no specific limit or minimum), the execution just hangs at pTempAcc->accSelect() and the only way to stop it is a forced exit. Can anyone tell me why this might happen.

    enhzflepE 1 Reply Last reply
    0
    • K kartikdasani

      I use the following lines of code in my program to get focus to a particular object and select it: hr = (SELFLAG_TAKEFOCUS,varTemp); hr = pTempAcc->accLocation(&left,&top,&width,&height,varTemp); The trouble is that after the my program has been running for a while ( as such there is no specific limit or minimum), the execution just hangs at pTempAcc->accSelect() and the only way to stop it is a forced exit. Can anyone tell me why this might happen.

      enhzflepE Offline
      enhzflepE Offline
      enhzflep
      wrote on last edited by
      #2

      There appears to be some code missing from the 1st line you posted. Looking at the MSDN page for IAccessible::accSelect Method[^] we can see an example given as:

      HRESULT SelectItemAtPoint(POINT point)
      {
      VARIANT varItem;
      IAccessible* pAcc;
      HRESULT hr = AccessibleObjectFromPoint(point, &pAcc, &varItem);
      if ((hr == S_OK))
      {
      hr = pAcc->accSelect((SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION), varItem);
      VariantClear(&varItem);
      pAcc->Release();
      }
      return hr;
      }

      Which immediately causes me to wonder if perhaps you haven't done the clean-up for your equivalents of varItem and pAcc in the above block

      K 1 Reply Last reply
      0
      • enhzflepE enhzflep

        There appears to be some code missing from the 1st line you posted. Looking at the MSDN page for IAccessible::accSelect Method[^] we can see an example given as:

        HRESULT SelectItemAtPoint(POINT point)
        {
        VARIANT varItem;
        IAccessible* pAcc;
        HRESULT hr = AccessibleObjectFromPoint(point, &pAcc, &varItem);
        if ((hr == S_OK))
        {
        hr = pAcc->accSelect((SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION), varItem);
        VariantClear(&varItem);
        pAcc->Release();
        }
        return hr;
        }

        Which immediately causes me to wonder if perhaps you haven't done the clean-up for your equivalents of varItem and pAcc in the above block

        K Offline
        K Offline
        kartikdasani
        wrote on last edited by
        #3

        The same problem occurs even when i give both the flags as follows:

        hr = pAcc->accSelect((SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION), varItem);

        enhzflepE 1 Reply Last reply
        0
        • K kartikdasani

          The same problem occurs even when i give both the flags as follows:

          hr = pAcc->accSelect((SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION), varItem);

          enhzflepE Offline
          enhzflepE Offline
          enhzflep
          wrote on last edited by
          #4

          Do you perform the clean-up as shown in the example in my last post?

          K 1 Reply Last reply
          0
          • enhzflepE enhzflep

            Do you perform the clean-up as shown in the example in my last post?

            K Offline
            K Offline
            kartikdasani
            wrote on last edited by
            #5

            Clean up does not help either.

            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