473,503 Members | 2,157 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

COM class error 80040154

Frinavale
9,735 Recognized Expert Moderator Expert
This article is specifically about the error code 80040154. If you are not seeing this error code then the follow information may not apply to you. If you are seeing a 80040150 error you should probably also read through this article but it is highly likely your registry is messed up by multiple versions of your COM component being registered with the operating system.

Looking on the web for information about this error can be frustrating and tedious because the error code is vague and there is no official explanation about it from Microsoft.

From my experience I have discovered that this error is caused by one or more of the following:
  • Insufficient permissions have been applied to the COM component to allow the user running the application to access/use it
  • The component was registered using the incorrect regsvr32 tool for the operating system platform that it is being used on
  • The visual studio project build settings are targeting an incorrect platform

The first point is the most common cause to the 80040154 error. You have to make sure that the user running the application has sufficient permissions to read/execute the component. In the past, all 32bit COM components had to be placed into the C:\Windows\SysWoW64 folder so that the 64bit operating system could run the component properly. Setting permissions on this folder and the components within it could compromise your operating system if you apply them incorrectly. For example, if you are developing a web application that uses a COM component, you should NEVER give the internet user account permissions to this folder! You can now move the 32bit COM components out of the SysWoW64 folder to another place and use appropriate tools to tell the operating system how to execute them.

That brings me to the second point, if your application is going to be executed on a 64bit operating system and your COM component is 32bit, you need to make sure that the correct regsvr32 tool is used to register your COM component.

There are 2 versions of this tool on a 64bit Windows Operating system.
  • One exists in the C:\Windows\system32 folder. This one is the default tool used to register COM components and works perfectly fine to register 32bit COM components on 32bit operating systems; however on a 64bit operating system it is meant to register 64bit components.
  • On 64bit operating systems, another version of this tool exists in the C:\Windows\SysWoW64 folder. This version registers 32bit components in a way that allows them to work properly on a 64bit operating system.

It is important to use the correct tool to register your COM component properly with the operating system that it is be used on.

The third point is important to note because even if you have set up everything correctly so far you will still get this error on 64bit operating systems if your application doesn't specify that it needs to be run under a 32bit platform. You will get this error when you run your application on a 64bit operating system if your project's build settings are targeting "Any CPU" or "x64". Change this setting to target "x86" in order to tell the operating system that it needs to use the 32bit platform when running the application.


So, if you are are experiencing this error right now, I recommend that you:
  • Uninstall your component using the regsvr32 tool(s)
  • Ensure that the component is located in a folder that you can apply appropriate permissions to so that the user running the application can read/execute it
  • Apply the appropriate permissions to the component and, if need be, the folder containing the component
  • Register the component with the operating system using the correct regsvr32 tool
  • Re-reference the component in your project
  • Configure your project's build settings to target the x86 platform
  • Compile and run the application

This should fix the problem.

If you are seeing a 80040150 error, then your registry is messed up. Use the regsvr32 tools to unregister your component in every location that it exists on your operating system, reboot the system and use the appropriate regsvr32 tool register the one component that you are interested in. If you are still getting the error, unregister the component and then use the regedit tool to search through your registry to remove any entries that were not properly cleaned up. After you have done this, try again.


Please note that if your COM object is really a true COM component (not developed using .NET code) then regasm will not work. I know a lot of people try to use it but it's not applicable to these COM components.

A note specific to running ASP.NET application:

If your web application uses a 32 bit COM component and your web server is a 64bit operating system you need to make sure that your website is running under a 32bit application pool or else you will see a "Bad Format Image" error. Setting the application pool is different for each version of IIS, so please research this topic so that your application can run properly.


I know these errors can be frustrating and it seems like there is no fixing them. I really hope this article helps you out!

-Frinny
Nov 8 '13 #1
0 16817

Sign in to post your reply or Sign up for a free account.

Similar topics

4
9132
by: Martin Franklin | last post by:
I am trying to get a total record count on a Acess 97 mdb database. However I get the following error when I try to load the page: Provider error '80040154' Class not registered...
2
1631
by: Zardoz | last post by:
I've created a new header file in which one will find : #using <mscorlib.dll> using namespace System; __gc class G { public: int k; int sum(int){return 0;}
4
10289
by: omrivm | last post by:
Hi, I have a problem with Outlook Redemption, every time I'm trying to create a new RDOAddressBook: Redemption.RDOAddressBook AB = new RDOAddressBook(); I get: "Retrieving the COM class factory...
0
2954
by: Shailesh Patel | last post by:
Hi, I get the following error. Retrieving the COM class factory for component with CLSID {F84433FF-2369-4427-B6FB-3CBA67EDA7EB} failed due to the following error: 80040154 ASP.NET(VB.NET)...
2
10696
by: RodneyAnonymous | last post by:
I've got some code for composing an e-mail from the contents of an RTF box. The first time I execute it, everything works fine. If I close my app and then re-run it, however, I always receive the...
4
4560
by: mojde | last post by:
Hi all, I am using : 1. Windows XP-Visual Studio 2005 2. FastReport Studio Trial (www.fast-report.com) I have used FastReport Studio Trial (FastReport3.dll) in my ASP.NET web Site...
3
14116
by: mojde | last post by:
Hi all, I am using : 1. Windows XP-Visual Studio 2005 2. FastReport Studio Trial (www.fast-report.com) I have used FastReport Studio Trial (FastReport3.dll) in my ASP.NET web Site...
10
32037
by: Meganutter | last post by:
Hello, I have been stuck with this error for a while now and really want to get it fixed. The catch here is, i need to rewrite code and update it. when i use the old code the page loads as its...
4
4958
by: comtrendz | last post by:
Application fails with error: 80040154 when attempting to open a doc in Word 2010. I have a VB.Net app that uses word to open documents. I am running VS 2008 on my PC with Office 2003. When I...
1
5196
seraieis
by: seraieis | last post by:
(VB.NET) I've been searching for 3 days trying to figure out why this is happening, but I'm out of luck and out of my mind! Anyone have any idea why this is happening? I get this error as soon as I...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.