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. COM
  4. Getting COM Error: Scalar deleting destructor.

Getting COM Error: Scalar deleting destructor.

Scheduled Pinned Locked Moved COM
comtestingtoolshelp
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.
  • K Offline
    K Offline
    KTTransfer
    wrote on last edited by
    #1

    Hi, I am working on Excel Automation. Implemented the logic to retrieve all the running Excel instances, now I am getting IDispatch pointer. Assigning this IDispatch Pointer to Excel object. Following is the code: IDispatch* p=NULL; HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, __uuidof(IDispatch), (void**)&p); if(hr == S_OK) { try { Excel::WindowsPtr pWindow = NULL; HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow); Excel::_ApplicationPtr xl; xl = pWindow->Application; But getting com exception at above line. The com error: _Vfpointer: scalar deleting destructor(unsigned int) m_hresult:"Member not found". I googled but there is no clarity in solution. If any clue, please let me know. Thanks in Advance. Regards, KTTransfer.

    S 1 Reply Last reply
    0
    • K KTTransfer

      Hi, I am working on Excel Automation. Implemented the logic to retrieve all the running Excel instances, now I am getting IDispatch pointer. Assigning this IDispatch Pointer to Excel object. Following is the code: IDispatch* p=NULL; HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, __uuidof(IDispatch), (void**)&p); if(hr == S_OK) { try { Excel::WindowsPtr pWindow = NULL; HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow); Excel::_ApplicationPtr xl; xl = pWindow->Application; But getting com exception at above line. The com error: _Vfpointer: scalar deleting destructor(unsigned int) m_hresult:"Member not found". I googled but there is no clarity in solution. If any clue, please let me know. Thanks in Advance. Regards, KTTransfer.

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      KTTransfer wrote:

      Excel::WindowsPtr pWindow = NULL; HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow);

      What's the deal with this? You'd hope Excel::WindowsPtr wraps an IDispatch pointer (does it?). Try this:

      Excel::WindowsPtr pWindow = NULL;
      HRESULT hr = p->QueryInterface(&pWindow);

      Steve

      K 1 Reply Last reply
      0
      • S Stephen Hewitt

        KTTransfer wrote:

        Excel::WindowsPtr pWindow = NULL; HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow);

        What's the deal with this? You'd hope Excel::WindowsPtr wraps an IDispatch pointer (does it?). Try this:

        Excel::WindowsPtr pWindow = NULL;
        HRESULT hr = p->QueryInterface(&pWindow);

        Steve

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

        I tried this,in this case I am getting "hresult hr" as "E_NOINTERFACE".

        S 1 Reply Last reply
        0
        • K KTTransfer

          I tried this,in this case I am getting "hresult hr" as "E_NOINTERFACE".

          S Offline
          S Offline
          Stephen Hewitt
          wrote on last edited by
          #4

          I'd take it at its word.

          Steve

          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