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. Problem with creating a component

Problem with creating a component

Scheduled Pinned Locked Moved COM
helpc++comwindows-admin
9 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.
  • R Offline
    R Offline
    rajeev82
    wrote on last edited by
    #1

    Hi all, I've created a simple COM component using ATL and itz registered also.When i tried to create the component using CoCreateInstance i get a HRESULT which tells that "0x80040111 ClassFactory cannot supply requested class ". There is only one instance of the component present in the registry and the CLSID,Interface ID everything i passed to the COCreateInstance are correct but still the problem is not over. Any help would be greatly apppreciated.Thanks in advance. Regards, Rajeev

    C 1 Reply Last reply
    0
    • R rajeev82

      Hi all, I've created a simple COM component using ATL and itz registered also.When i tried to create the component using CoCreateInstance i get a HRESULT which tells that "0x80040111 ClassFactory cannot supply requested class ". There is only one instance of the component present in the registry and the CLSID,Interface ID everything i passed to the COCreateInstance are correct but still the problem is not over. Any help would be greatly apppreciated.Thanks in advance. Regards, Rajeev

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      Try to load the component using OLEVIEW tool. Also try to post the CoCreateInstance code snippet. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      R 1 Reply Last reply
      0
      • C CPallini

        Try to load the component using OLEVIEW tool. Also try to post the CoCreateInstance code snippet. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

        R Offline
        R Offline
        rajeev82
        wrote on last edited by
        #3

        CLSID aclsid; //interface to be created IMIConverter *m_pToConverter = NULL; aIUnknown = NULL; HRESULT hr; //this step also gets the correct class ID hr = CLSIDFromProgID(L"MITFConverter.MIConverter",&aclsid); // This HRESULT gives the problem hr=CoCreateInstance(aclsid,NULL,CLSCTX_ALL,IID_IMIConverter,(void**)&m_pToConverter); Thanks for your help

        C 1 Reply Last reply
        0
        • R rajeev82

          CLSID aclsid; //interface to be created IMIConverter *m_pToConverter = NULL; aIUnknown = NULL; HRESULT hr; //this step also gets the correct class ID hr = CLSIDFromProgID(L"MITFConverter.MIConverter",&aclsid); // This HRESULT gives the problem hr=CoCreateInstance(aclsid,NULL,CLSCTX_ALL,IID_IMIConverter,(void**)&m_pToConverter); Thanks for your help

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          Have you made an attempt (to load the Component) with OLEVIEW? The hr value you reported shouldn't happen since MSDN reports S_OK, REGDB_E_CLASSNOTREG or CLASS_E_NOAGGREGATION as possible return values. You can also try to use CoGetClassObject and then call CreateInstance on the (hopefully) obtained class factory pointer to see what is happening. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

          R 1 Reply Last reply
          0
          • C CPallini

            Have you made an attempt (to load the Component) with OLEVIEW? The hr value you reported shouldn't happen since MSDN reports S_OK, REGDB_E_CLASSNOTREG or CLASS_E_NOAGGREGATION as possible return values. You can also try to use CoGetClassObject and then call CreateInstance on the (hopefully) obtained class factory pointer to see what is happening. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

            R Offline
            R Offline
            rajeev82
            wrote on last edited by
            #5

            Hi, When i tried to load the component using OLE view it displays an MK_E_INVALIDEXTENSION error. I tried calling CoGetClassObject but the return is always the same (Class Factory cannot supply the requested class).I'm Totally lost :(( Is there Anything else that i can try?? Thanks for your help

            C 1 Reply Last reply
            0
            • R rajeev82

              Hi, When i tried to load the component using OLE view it displays an MK_E_INVALIDEXTENSION error. I tried calling CoGetClassObject but the return is always the same (Class Factory cannot supply the requested class).I'm Totally lost :(( Is there Anything else that i can try?? Thanks for your help

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #6

              as you can easily find here [^], CoGetClassObject cannot return such a hr value, hence I suggest to you to check well your code. can you post the hexadecimal value of the returned hr? :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

              R 1 Reply Last reply
              0
              • C CPallini

                as you can easily find here [^], CoGetClassObject cannot return such a hr value, hence I suggest to you to check well your code. can you post the hexadecimal value of the returned hr? :)

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

                R Offline
                R Offline
                rajeev82
                wrote on last edited by
                #7

                0x80040111..is the returned HRESULT s hexdecimal value...

                C 1 Reply Last reply
                0
                • R rajeev82

                  0x80040111..is the returned HRESULT s hexdecimal value...

                  C Offline
                  C Offline
                  CPallini
                  wrote on last edited by
                  #8

                  It seems something went wrong during registration. I'm sorry I cannot help you with this.

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

                  R 1 Reply Last reply
                  0
                  • C CPallini

                    It seems something went wrong during registration. I'm sorry I cannot help you with this.

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

                    R Offline
                    R Offline
                    rajeev82
                    wrote on last edited by
                    #9

                    That alright..Anyhow thanks a lot for ur help :)

                    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