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. Trouble with implement Com Local Server

Trouble with implement Com Local Server

Scheduled Pinned Locked Moved COM
comsysadminquestion
4 Posts 2 Posters 14 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.
  • T Offline
    T Offline
    Tri Cuong
    wrote on last edited by
    #1

    I'm writing a COM server exe using CLSCTX_LOCAL_SERVER as below. 1. COM Server . Use IDL language to define a interfaceID, classID. . Call CoRegisterClassObject to register a factory object . I designed COM Server source code as below class CMyFactory : public IClassFactory { }; class CMyObj : public IUnknown { -----class XSubClass : public IMyInterface -----{ -----}m_subClass; -----friend class CMyObj; } Before starting COM Server, I call CoRegisterClassObject to register factoryObject to system. 2. COM Client . IMyInterface* pObj; . CoGetClassObject(CLSID_CoMyObj, CLSCTX_LOCAL_SERVER, NULL, IID_IClassFactory, (void **) &pFac); . pFac->CreateInstance(NULL,IID_interfaceID,(void**)&pObj); However, the result of CreateInstance calling is "E_NOINTERFACE No such interface supported". Could you please tell me the way to solve it?

    L 1 Reply Last reply
    0
    • T Tri Cuong

      I'm writing a COM server exe using CLSCTX_LOCAL_SERVER as below. 1. COM Server . Use IDL language to define a interfaceID, classID. . Call CoRegisterClassObject to register a factory object . I designed COM Server source code as below class CMyFactory : public IClassFactory { }; class CMyObj : public IUnknown { -----class XSubClass : public IMyInterface -----{ -----}m_subClass; -----friend class CMyObj; } Before starting COM Server, I call CoRegisterClassObject to register factoryObject to system. 2. COM Client . IMyInterface* pObj; . CoGetClassObject(CLSID_CoMyObj, CLSCTX_LOCAL_SERVER, NULL, IID_IClassFactory, (void **) &pFac); . pFac->CreateInstance(NULL,IID_interfaceID,(void**)&pObj); However, the result of CreateInstance calling is "E_NOINTERFACE No such interface supported". Could you please tell me the way to solve it?

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

      See Introduction to COM - What It Is and How to Use It.[^].

      T 1 Reply Last reply
      0
      • L Lost User

        See Introduction to COM - What It Is and How to Use It.[^].

        T Offline
        T Offline
        Tri Cuong
        wrote on last edited by
        #3

        But it doesn't mention about COM Local sever

        L 1 Reply Last reply
        0
        • T Tri Cuong

          But it doesn't mention about COM Local sever

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

          You could try part II: Introduction to COM Part II - Behind the Scenes of a COM Server[^].

          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