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. C / C++ / MFC
  4. Class not registered error

Class not registered error

Scheduled Pinned Locked Moved C / C++ / MFC
c++debugginghelpquestion
13 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.
  • S sdancer75

    Hi, I created a source filter and is registered successfuly. Every time I use GraphEdit it works fine but when I try to use under MFC/C++ CoCreateInstance fails as not registered (error 0x80040154).

    hr = CoCreateInstance(CLSID_PIAsyncFile, NULL,CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pAsync);

    I tried again and again with regsvr32 and successfully registers the filter. What seems to be wrong here? I use 32Bit debug builds, on Win7 64bit system. Regards,

    sdancer75

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

    Make sure you've called CoInitialize or CoInitializeEx properly before calling CoCreateInstance.

    «_Superman_»  _I love work. It gives me something to do between weekends.

    _Microsoft MVP (Visual C++) (October 2009 - September 2013)

    Polymorphism in C

    S 1 Reply Last reply
    0
    • _ _Superman_

      Make sure you've called CoInitialize or CoInitializeEx properly before calling CoCreateInstance.

      «_Superman_»  _I love work. It gives me something to do between weekends.

      _Microsoft MVP (Visual C++) (October 2009 - September 2013)

      Polymorphism in C

      S Offline
      S Offline
      sdancer75
      wrote on last edited by
      #3

      Thanks, I have called the

      HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);

      at the class construction and

      CoUninitialize();

      at the destruction. Any other filter is successfully CoCreateInstance except my filter.

      sdancer75

      _ 1 Reply Last reply
      0
      • S sdancer75

        Thanks, I have called the

        HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);

        at the class construction and

        CoUninitialize();

        at the destruction. Any other filter is successfully CoCreateInstance except my filter.

        sdancer75

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

        Get the error returned in hr and use the Error Lookup tool check what the error is.

        «_Superman_»  _I love work. It gives me something to do between weekends.

        _Microsoft MVP (Visual C++) (October 2009 - September 2013)

        Polymorphism in C

        S 1 Reply Last reply
        0
        • _ _Superman_

          Get the error returned in hr and use the Error Lookup tool check what the error is.

          «_Superman_»  _I love work. It gives me something to do between weekends.

          _Microsoft MVP (Visual C++) (October 2009 - September 2013)

          Polymorphism in C

          S Offline
          S Offline
          sdancer75
          wrote on last edited by
          #5

          Hi, As you can see in question at the very begging, the error code is 0x80040154 which means "class is not registered" This is strange since the class is indeed registered at sysWOW3264 (a mirror registry for 32-bit windows apps running on 64bit windows) since my source filter is 32-bit. Under ms filter graph, I can find and use successfully the filter, but the problem still exists under my MFC project. PS:In my stdafx.h I declare my filter as follows

          #include "INITGUID.H"

          //{8576CEC8-964D-4B51-AC45-2B24DE748E23} My Async Source (File)
          DEFINE_GUID(CLSID_PIAsyncFile,
          0x8576CEC8, 0x964D, 0x4B51, 0xAC, 0x45, 0x2B, 0x24, 0xDE, 074, 0x8E, 0x23);

          Thanx

          sdancer75

          _ 1 Reply Last reply
          0
          • S sdancer75

            Hi, As you can see in question at the very begging, the error code is 0x80040154 which means "class is not registered" This is strange since the class is indeed registered at sysWOW3264 (a mirror registry for 32-bit windows apps running on 64bit windows) since my source filter is 32-bit. Under ms filter graph, I can find and use successfully the filter, but the problem still exists under my MFC project. PS:In my stdafx.h I declare my filter as follows

            #include "INITGUID.H"

            //{8576CEC8-964D-4B51-AC45-2B24DE748E23} My Async Source (File)
            DEFINE_GUID(CLSID_PIAsyncFile,
            0x8576CEC8, 0x964D, 0x4B51, 0xAC, 0x45, 0x2B, 0x24, 0xDE, 074, 0x8E, 0x23);

            Thanx

            sdancer75

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

            Sorry, I didn't notice the error code you posted in your question. I'm assuming that the MFC project is built as a 32-bit application. One more thing you can try - There are both 32-bit and 64-bit versions of regsvr32.exe available in %SystemRoot%\Windows\System32 and %Systemroot%\Windows\SysWOW64. Try registering the component with either of the 2 and check if the MFC application is able to find it.

            «_Superman_»  _I love work. It gives me something to do between weekends.

            _Microsoft MVP (Visual C++) (October 2009 - September 2013)

            Polymorphism in C

            S 1 Reply Last reply
            0
            • _ _Superman_

              Sorry, I didn't notice the error code you posted in your question. I'm assuming that the MFC project is built as a 32-bit application. One more thing you can try - There are both 32-bit and 64-bit versions of regsvr32.exe available in %SystemRoot%\Windows\System32 and %Systemroot%\Windows\SysWOW64. Try registering the component with either of the 2 and check if the MFC application is able to find it.

              «_Superman_»  _I love work. It gives me something to do between weekends.

              _Microsoft MVP (Visual C++) (October 2009 - September 2013)

              Polymorphism in C

              S Offline
              S Offline
              sdancer75
              wrote on last edited by
              #7

              Thanks, Yes I know and I already tried both versions of regsvr32 (32 & 64 Bit) but still does not work. Regards,

              sdancer75

              _ 1 Reply Last reply
              0
              • S sdancer75

                Thanks, Yes I know and I already tried both versions of regsvr32 (32 & 64 Bit) but still does not work. Regards,

                sdancer75

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

                All I can think of is that the COM component uses some dependency files like DLLs that GraphEdit is able to find but the MFC application is not. Does the COM component reside is some folder along with other dependency files. If so, you can either try to copy the EXE to that folder or change the working directory using the SetCurrentDirectory API.

                «_Superman_»  _I love work. It gives me something to do between weekends.

                _Microsoft MVP (Visual C++) (October 2009 - September 2013)

                Polymorphism in C

                S 1 Reply Last reply
                0
                • _ _Superman_

                  All I can think of is that the COM component uses some dependency files like DLLs that GraphEdit is able to find but the MFC application is not. Does the COM component reside is some folder along with other dependency files. If so, you can either try to copy the EXE to that folder or change the working directory using the SetCurrentDirectory API.

                  «_Superman_»  _I love work. It gives me something to do between weekends.

                  _Microsoft MVP (Visual C++) (October 2009 - September 2013)

                  Polymorphism in C

                  S Offline
                  S Offline
                  sdancer75
                  wrote on last edited by
                  #9

                  I am not sure about that.... The filter resides is a local folder and not in windows subfolder and is a "debug build". I will try to move the filter inside the C:\windows\SysWOW64 and register again.

                  sdancer75

                  S 1 Reply Last reply
                  0
                  • S sdancer75

                    I am not sure about that.... The filter resides is a local folder and not in windows subfolder and is a "debug build". I will try to move the filter inside the C:\windows\SysWOW64 and register again.

                    sdancer75

                    S Offline
                    S Offline
                    sdancer75
                    wrote on last edited by
                    #10

                    Nope !! It drives me crazy. Check an image of the filter registration at the link http://postimg.org/image/ulitc333r/[^] I am attaching you also the source code of the "testfilter code" as well as the filter itself http://rapidshare.com/files/1664813497/TestWin32.zip http://rapidshare.com/files/1868088316/piasyncd.zip[^]

                    sdancer75

                    S 1 Reply Last reply
                    0
                    • S sdancer75

                      Nope !! It drives me crazy. Check an image of the filter registration at the link http://postimg.org/image/ulitc333r/[^] I am attaching you also the source code of the "testfilter code" as well as the filter itself http://rapidshare.com/files/1664813497/TestWin32.zip http://rapidshare.com/files/1868088316/piasyncd.zip[^]

                      sdancer75

                      S Offline
                      S Offline
                      sdancer75
                      wrote on last edited by
                      #11

                      Finally Solved ! A tiny error at the CLSID declaration !

                      sdancer75

                      J 1 Reply Last reply
                      0
                      • S sdancer75

                        Finally Solved ! A tiny error at the CLSID declaration !

                        sdancer75

                        J Offline
                        J Offline
                        Jesusjenifer
                        wrote on last edited by
                        #12

                        Can you please tell me what is the small fix from CLSID declaration?Even i am suffering with this class not registered problem

                        S 1 Reply Last reply
                        0
                        • J Jesusjenifer

                          Can you please tell me what is the small fix from CLSID declaration?Even i am suffering with this class not registered problem

                          S Offline
                          S Offline
                          sdancer75
                          wrote on last edited by
                          #13

                          Not fix at all, just a typing error in my CLID declaration. What error do you get ?

                          sdancer75

                          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