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#
  4. error 80040154 at instantiation of COM object

error 80040154 at instantiation of COM object

Scheduled Pinned Locked Moved C#
csharpdotnetcomsysadmin
3 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.
  • M Offline
    M Offline
    mkrelli
    wrote on last edited by
    #1

    Hello everybody. I'm actually working on a service for phone call notification... However, to achieve that I downloaded a library called CapiThread (this is a sort of wrapper for the capi2032.dll). This is an "old" Win32 dll that exports 5 methods. (InitCapiThread, CloseCapiThread, RegisterNotifyMessage, SetRequest, GetIndication). To use that dll within a C# Windows-Service project i've written a COM wrapper (COM Object ISDNCapi). The ISDNCapi object retrieves the notifications thrown by the CapiThread dll if an indication is pending and fires an event (OnCapiIndication). There are some other classes to hold the data of the indications and requests. Okay... Now i've build a metadata-dll with TLBIMP that i use in my program. (As descripted in "COM Interoperability in .NET Framework: Part I"). The code compiles without any problems, but during the instantiation of my class ISDNCapi the following error raises: Retrieving the COM class factory for component with CLSID {3A5119AE-E5CC-406F-8F62-FFC340C424CE} failed due to the following error: 80040154. The component is definetly registered and can access it's dependecies, because instantiation it in VB6 causes no error and the regsvr32 succeeds also. So what i'm doing wrong? (While writing this article i'd an idea: I'm using WinXP x64 platform. Could that be the cause of the error? - But i'm definetly compiling for Win32) I've uploaded the sources of my projects to my server: CapiWrapperSln ISDNMonServer And here are the complete exception details: System.Runtime.InteropServices.COMException was unhandled Message="Retrieving the COM class factory for component with CLSID {3A5119AE-E5CC-406F-8F62-FFC340C424CE} failed due to the following error: 80040154." Source="ISDNMonServer" ErrorCode=-2147221164 StackTrace: at ISDNMonServer.ISDNMonServer..ctor() in E:\Entwicklungsumgebung\Projekte\Office\ISDNMon\ISDNMonServer\ISDNMonServer.cs:line 20 at ISDNMonServer.Program.Main() in E:\Entwicklungsumgebung\Projekte\Office\ISDNMon\ISDNMonServer\Program.cs:line 22 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

    M 1 Reply Last reply
    0
    • M mkrelli

      Hello everybody. I'm actually working on a service for phone call notification... However, to achieve that I downloaded a library called CapiThread (this is a sort of wrapper for the capi2032.dll). This is an "old" Win32 dll that exports 5 methods. (InitCapiThread, CloseCapiThread, RegisterNotifyMessage, SetRequest, GetIndication). To use that dll within a C# Windows-Service project i've written a COM wrapper (COM Object ISDNCapi). The ISDNCapi object retrieves the notifications thrown by the CapiThread dll if an indication is pending and fires an event (OnCapiIndication). There are some other classes to hold the data of the indications and requests. Okay... Now i've build a metadata-dll with TLBIMP that i use in my program. (As descripted in "COM Interoperability in .NET Framework: Part I"). The code compiles without any problems, but during the instantiation of my class ISDNCapi the following error raises: Retrieving the COM class factory for component with CLSID {3A5119AE-E5CC-406F-8F62-FFC340C424CE} failed due to the following error: 80040154. The component is definetly registered and can access it's dependecies, because instantiation it in VB6 causes no error and the regsvr32 succeeds also. So what i'm doing wrong? (While writing this article i'd an idea: I'm using WinXP x64 platform. Could that be the cause of the error? - But i'm definetly compiling for Win32) I've uploaded the sources of my projects to my server: CapiWrapperSln ISDNMonServer And here are the complete exception details: System.Runtime.InteropServices.COMException was unhandled Message="Retrieving the COM class factory for component with CLSID {3A5119AE-E5CC-406F-8F62-FFC340C424CE} failed due to the following error: 80040154." Source="ISDNMonServer" ErrorCode=-2147221164 StackTrace: at ISDNMonServer.ISDNMonServer..ctor() in E:\Entwicklungsumgebung\Projekte\Office\ISDNMon\ISDNMonServer\ISDNMonServer.cs:line 20 at ISDNMonServer.Program.Main() in E:\Entwicklungsumgebung\Projekte\Office\ISDNMon\ISDNMonServer\Program.cs:line 22 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

      M Offline
      M Offline
      mav northwind
      wrote on last edited by
      #2

      Hi! The error 0x80040154 means "Class not registered". Your component itself may be registered, but the error states that the Class Factory (!) could not be retrieved because it's not registered. Could it be that your COM wrapper is missing this point? Btw. why do you need the COM wrapper? You can call functions from "legacy" Win32 dlls using P/invoke without having to use a COM wrapper...

      Regards, mav -- Black holes are the places where god divided by 0...

      M 1 Reply Last reply
      0
      • M mav northwind

        Hi! The error 0x80040154 means "Class not registered". Your component itself may be registered, but the error states that the Class Factory (!) could not be retrieved because it's not registered. Could it be that your COM wrapper is missing this point? Btw. why do you need the COM wrapper? You can call functions from "legacy" Win32 dlls using P/invoke without having to use a COM wrapper...

        Regards, mav -- Black holes are the places where god divided by 0...

        M Offline
        M Offline
        mkrelli
        wrote on last edited by
        #3

        i thougt i'd already answered... hm, maybe i forgot to post it :doh: i've created the project with the option "component registrar". do i have to call the RegisterAll function of the Registrar class? in vc 6 i never had to register the class factory separately... so i don't really know what to look for :-> . can you please check it in my sourcecode i've posted before? i know that i can youse P/invoke. but i've choosen to build a com wrapper, because i want to have a more general solution. so i can use it with other languages... and i found the event handlers better than hooking on notify messages (in C#) the CapiThread.dll sends. thx. Martin

        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