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. GetIDsOfNames returning -1

GetIDsOfNames returning -1

Scheduled Pinned Locked Moved COM
c++comhelp
2 Posts 2 Posters 6 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.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    Hi, I am writting a COM app using the MFC wrappers There are however certain methods/properties which don't have C/C++ prototypes so I decided to use native OLE functions I never got by GetIDsOfNames as what ever method name I insert I get a -1 I have tried native OLE

    CoInitialize(NULL);  //native ole
    CLSID clsid;         // initialization
    HRESULT hr = CLSIDFromProgID(L"Excel.Application",&clsid);
    

    and the MFC wrappers function

    _application::CreateDispath

    as this method populates

    m_lpDispatch

    And whatever method property I use I get -1 Any help appreciated

    L 1 Reply Last reply
    0
    • F ForNow

      Hi, I am writting a COM app using the MFC wrappers There are however certain methods/properties which don't have C/C++ prototypes so I decided to use native OLE functions I never got by GetIDsOfNames as what ever method name I insert I get a -1 I have tried native OLE

      CoInitialize(NULL);  //native ole
      CLSID clsid;         // initialization
      HRESULT hr = CLSIDFromProgID(L"Excel.Application",&clsid);
      

      and the MFC wrappers function

      _application::CreateDispath

      as this method populates

      m_lpDispatch

      And whatever method property I use I get -1 Any help appreciated

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You need to use the GetLastError function[^] to determine why it fails.

      One of these days I'm going to think of a really clever signature.

      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