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. Error - hr = 0x80040110 Class does not support aggregation (or class object is remote)

Error - hr = 0x80040110 Class does not support aggregation (or class object is remote)

Scheduled Pinned Locked Moved COM
helptestingtools
4 Posts 3 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.
  • P Offline
    P Offline
    pandit84
    wrote on last edited by
    #1

    Hi , I am creating a Unit Test script in CPPUnit for a new component. I am calling CoCreateInstance ()for a component to be created , but i am getting the error in subject line. Please provide the comments so that i can resolve the issue.

    _ F 2 Replies Last reply
    0
    • P pandit84

      Hi , I am creating a Unit Test script in CPPUnit for a new component. I am calling CoCreateInstance ()for a component to be created , but i am getting the error in subject line. Please provide the comments so that i can resolve the issue.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      Since the COM component does not support aggregation, pass a NULL as the second parameter to CoCreateInstance.

      «_Superman_»

      P 1 Reply Last reply
      0
      • _ _Superman_

        Since the COM component does not support aggregation, pass a NULL as the second parameter to CoCreateInstance.

        «_Superman_»

        P Offline
        P Offline
        pandit84
        wrote on last edited by
        #3

        Actually my component support aggregation , i am making unit test script using CPPUnit framwork. HRESULT hr = CLSIDFromString( _T("{3E31EB53-8CEF-4FC9-94AC-8619887851D3}"), &clsidTemp ); hr = CoCreateInstance(clsidTemp, GetControllingUnknown() , CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&m_pMessageRouter); here i am getting error in subject line in hr.. Please provide comments.

        1 Reply Last reply
        0
        • P pandit84

          Hi , I am creating a Unit Test script in CPPUnit for a new component. I am calling CoCreateInstance ()for a component to be created , but i am getting the error in subject line. Please provide the comments so that i can resolve the issue.

          F Offline
          F Offline
          frx96
          wrote on last edited by
          #4

          //sClassName eg:ResoftSign.ResoftSignCtrl //ResoftSign is the lib name //ResoftSignCtrl is the class name IDispatch* CreateClassComDispatch(BSTR sClassName) { CLSID clsid; IUnknown *pUnk; IDispatch *pDisp; HRESULT hr; CLSIDFromProgID(sClassName, &clsid); hr = CoInitialize(NULL); //see here. if(FAILED(hr)) return FALSE; hr = CoCreateInstance(clsid,NULL,CLSCTX_ALL,IID_IUnknown,(void**)&pUnk); if(FAILED(hr)) return FALSE; hr = pUnk->QueryInterface(IID_IDispatch, (void **)&pDisp); if(FAILED(hr)) { pUnk->Release(); return FALSE; } return pDisp; }

          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