Windows error 0x80040155, -2147221163

Detailed Error Information

REGDB_E_IIDNOTREG[1]

MessageInterface not registered
Declared inwinerror.h

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode4 (0x004)
NameFACILITY_ITF[2][1]
DescriptionThe source of the error code is COM/OLE Interface management.[2][1]
Error Code341 (0x0155)

Questions

9votes
2answers

Calling 32bit COM from c# running in 64bit mode

I have a 3rd party COM object(32 bit) that I need to call from my c# application (64 bit). I know I have to run the COM object in a separate process. This COM object has many classes implemented in it, so I'm trying to avoid writing my own remoting [...] read more
c#
.net
com
64-bit
6votes
1answer

Visual Studio 2013 High DPI workaround causes debugger to fail

Similar to this question Visual Studio 2013 High DPI on 4k Screen to which I had posted an answer but have now removed since uncovering the issue below. I too have just bought a new 4K laptop and have been having problems with high DPI with the display of the [...] read more
visual-studio-2013
ssms-2014
ssdt-bi
6votes
1answer

Using COM Exe Server w/o Registry in Win7

I have an existing COM Exe Server, and VBA or .NET code calling it. We'd like to make it work w/o needing to install or modify the registry so that other users that are not admins on their machines can use it. Let's assume changing/modifying the COM Exe Server is [...] read more
.net
windows
windows-7
com
5votes
1answer

Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' {00063001-0000-0000-C000-000000000046} HRESULT: 0x80040155

I'm having an issue with a very simple piece of C# .NET code which should (for now) simply retrieve the version number of Office installed on the computer running a WinForms application: var oApp = new Outlook.ApplicationClass(); var outlookVersionString = oApp.Version; It instantiates the object correct, however when I try [...] read more
c#
.net
outlook
ms-office
4votes
2answers

Standard COM marshaler fails with REGDB_E_IIDNOTREG

I'm trying to marshal an interface to another thread. Windows provides the convenient CoMarshalInterThreadInterfaceInStream helper function to take care of the boilerplate code associated with using CoMarshalInterface directly. const Guid CLSID_Widget = "{F8383852-FCD3-11d1-A6B9-006097DF5BD4}"; const Guid IID_IWidget = "{EBBC7C04-315E-11D2-B62F-006097DF5BD4}"; //Create our widget HRESULT hr = CoCreateInstance(CLSID_Widget, null, CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, IID_IWidget, [...] read more
winapi
com
typelib
3votes
1answer

Cannot create an instance of Excel 2016 in Visual Studio 2015

I have Visual Studio 2015 and my application is for .NET Framework 4.0. I installed Microsoft Office Home&Buissness 2016 and trying tocreate an instance using this code: Microsoft.Office.Interop.Excel.Application excelAppTemplate = new Microsoft.Office.Interop.Excel.Application(); but I get this error: > Unable to cast COM object of type 'System.__ComObject' to interface type > [...] read more
c#
2votes
3answers

Using C# to administer IIS

I would like to create an app that will deploy a website. Basically, I just want this app to copy the publish files to the webserver in a new folder, change the website to that folder, then recycle the app pool. I found out that I should be able to [...] read more
c#
visual-studio-2013
deployment
iis-7.5
2votes
1answer

Casting to an interface from a COM library fails on the 16th managed thread within IIS (InvalidCastException, WinRT originate error 0x80040155)

I'm posting this mostly for anyone else that hits this weird issue, and if anyone can shed a light on why IIS/Cassini is being a devil. For the most part, we can successfully cast a Dispatch object defined in ODL as [ uuid(GUID_FOO) ] dispinterface IFooDisp { ... properties & [...] read more
c#
com
interop
cassini
ole-automation
2votes
2answers

Interface not registered (0x80040155) on return from COM call

I'm making a synchronous cross-process COM call that executes successfully, but when I check the HRESULT returned it's the aforementioned 0x80040155, or "Interface not Registered" and the out parameter doesn't contain any data. Is there a way to re-register COM executibles? I'm not even sure that this would fix it, [...] read more
c++
com
2votes
0answers

Getting Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Runtime.Hosting.IClrStrongName' after switching to VSTest

We recently switched our automated unit tests from MSTest to VStest. After the switch several of the unit tests started failing giving the following error message, > Test method > Domain.Model.IntegrationTests.Documents.DocumentFilesRepositoryTest.Delete_file_Page_not_shared_can_delete > threw exception: > > System.InvalidCastException: Unable to cast COM object of type > 'System.__ComObject' to interface type > [...] read more
.net
unit-testing
com
strongname
vstest
2votes
1answer

Getting exception when trying to add Outlook 2010 form region (.ofs file) to Visual Studio 2012

I get this message after I click "Finish" on new Form Region wizard > An error occurred while processing file [file path].ofs > > Error: Unable to cast COM object of type System._ComObject to interface type > Microsoft.Vbe.Forms.UserForm. This operation failed because the QueryInterface > call on the COM component [...] read more
outlook
visual-studio-2012
outlook-addin
outlook-2010
1vote
0answers

Unable to Retrieve IMFAudioPolicy from Media Session

I have developed Win32 app based heavily on the MF_ProtectedPlayback sample here. I'm using 4 cplayer objects at a time. It works for what I need it to do. However, I am trying to group the sessions, so that they are controlled by one volume control in control panel, as [...] read more
c++
windows
audio
ms-media-foundation
1vote
2answers

How can I figure out the class name from an interface ID (IID) in WinRT?

I have a XAML C++/WinRT application based on the BlankApp template. As I built up the app, I realized that my application is throwing a lot of exceptions behind the scenes in my output window. The exception I'm trying to understand is the following: Exception thrown at 0x00007FFA9EFA9149 (KernelBase.dll) in [...] read more
windows-runtime
c++-winrt
1vote
2answers

Windows Docker Toolbox won't start

Attempting to start up Docker Toolbox 1.12.0 on Windows 10 and getting the following error Running pre-create checks... Creating machine... (default) Copying C:\Users\abc\.docker\machine\cache\boot2docker.iso to C:\Users\abc\.docker\machine\machines\default\boot2docker.iso... (default) Creating VirtualBox VM... (default) Creating SSH key... Error creating machine: Error in driver during machine creation: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe createvm --basefolder C:\Users\abc\.docker\machine\machines\default --name default --register [...] read more
windows
docker
docker-machine
docker-toolbox
1vote
2answers

SSIS Issue: The Component cannot be added to the Data Flow task

I tried creating a new SSIS package and when I tried Doping a Data Flow Source (say OLEDB Source). I get the error The Component cannot be added to the Data Flow task. With the following Additional information ADDITIONAL INFORMATION: Interface not registered (Exception from HRESULT: 0x80040155) (Microsoft.SqlServer.DTSPipelineWrap) read more
ssis
1vote
2answers

Microsoft.Office.Interop.Excel failure on initialization (Office 2016)

This is the code which i was using before the Office 2016 installation. var excelApp = new Excel.Application(); excelApp.Visible = true; Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(finfo.FullName, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, false, false); Excel.Sheets excelSheets = excelWorkbook.Worksheets; Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(currentSheet); var cellValue =(excelWorksheet.Cells[a, [...] read more
c#
excel
excel-interop
office-2016
1vote
1answer

I got an InvalidCastException error while trying to send a Email in C#

I am tring to send a email from my C#(winform) app to an adress outlook but I am getteing an error on the line below : Outlook.MailItem mail =(Outlook.MailItem)_app.CreateItem(Outlook.OlItemType.olMailItem); I got the following error : > Unable to cast COM object of type > ‘Microsoft.Office.Interop.Outlook.ApplicationClass’ to interface type > ‘Microsoft.Office.Interop.Outlook._Application’. [...] read more
c#
winforms
1vote
1answer

CameraPreviewImageSource.StartPreviewAsync doesn't work with videoEncodingProperties

I'm using CameraPreviewImageSource.PreviewFrameAvailable event to determine flashes by calculating average luminosity of each frame. For my purposes I don't need big frames, but with default settings StartPreviewAsync() method generates frames with size 1280*720px. I tried to use StartPreviewAsync(videoEncodingProperties) but every time I get an exception HRESULT:0x80040155 Interface not registered. I [...] read more
lumia-imaging-sdk
1vote
1answer

Interface not registered (Exception from HRESULT: 0x80040155) on Nuget

I've been using Nuget up until today and suddenly been hit with the following error: Interface not registered (Exception from HRESULT: 0x80040155) No more details are provided. It happens if I open the "Manage Nuget Packages" window or I open the Nuget console. It happens on VS2010, 2012 and 2013. [...] read more
nuget
1vote
0answers

Marshalling D3D11Device and D3D11DeviceContext objects

This article says: > The ID3D11DeviceContext methods (except for those that exist on > ID3D11DeviceChild) are not free-threaded, that is, they require single > threading. Only one thread may safely be calling any of its methods (Draw, > Copy, Map, etc.) at a time. I was wondering if I can [...] read more
c++
multithreading
com
marshalling
direct3d11
1vote
0answers

Accessing COM object property in JScript results in a Permission Denied error

Where I work we have a proprietary C++ wrapper around IE which we pull into a JScript script as a COM object. There are a few events of this object that we wire to some JScript callbacks. The webpage "DocumentLoad" event in particular has 4 callback functions wired to it. [...] read more
com
permission-denied
jscript
1vote
3answers

Control IIS 7 server from Windows 2003 server programmatically

We run various jobs using a Windows 2003 server. Some of these jobs send app pool commands to web servers running IIS 6 (recycle, start, stop). Now we have a Windows 2008 web server running IIS 7, and we want to send the same commands. This is all done using [...] read more
c#
iis
iis-7
windows-server-2008
windows-server-2003
0votes
1answer

Calling Word method Application.ComAddins crashes after downgrading from Office 2013 to Office 2010

Some of our clients downgraded from Office 2013 to Office 2010. After doing that if you call the Application property ComAddins you get the following exception: System.Runtime.InteropServices.COMException (0x8002801D): Library not registered. (Excepción de HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)) at Microsoft.Office.Interop.Word.ApplicationClass.get_COMAddIns() at our own code We have tried to reinstall Office doing different [...] read more
c#
.net
ms-word
com
ms-office
0votes
0answers

Microsoft.Office.Interop.Word.dll - InvalidCastException

I have Office 365 installed on my machine. Particularly MS Word version is 2012. I have created C# project (VS 2019) and referenced microsoft word 16.0 object. It appeared as C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Office.Interop.Word\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll. at that following code Application application = new Application(); var document = application.Documents.Open(args[0]) throws System.InvalidCastException: 'Unable to cast COM [...] read more
c#
office-interop
0votes
1answer

Can CanvasVirtualControl work as a UIElement for UWP PrintDocument?

In attempting to print from a UWP app (in C++/winrt) using CanvasVirtualControl as a source the print UI appears fine but with a blank preview. The printrequest seems to work and the events for Paginate, etc. are called. For this test I have stored the CanvasVirtualControl in which the drawing [...] read more
c++-winrt
win2d
0votes
1answer

MS Visio 2010 hangs when editing UML diagrams

On all four of my Windows 7 x64 Pro computers with Visio Pro 2010 installed, I have had the following problem for the past several months: When I edit a Visio document that uses the UML stencil, as soon as I try to edit any object information, for example, define [...] read more
visio
0votes
2answers

Spying Elements in Blue Prism - HTML

I am attempting to spy elements of a web page in Blue Prism however I am getting the below error message. > System.ApplicationException: Interface not registered (Exception from HRESULT: > 0x80040155) at BluePrism.AMI.clsAMI.Spy(clsElementTypeInfo& elementType, > List`1& identifiers) at > Automate.frmIntegrationAssistant.HandleSpyOrLaunchClick(Object sender, > EventArgs e) please can someone assist? * application [...] read more
element
spying
0votes
0answers

Trying to cast a DTE project to a VCProject causes an exception saying DLL not registered

I am using VS 2017 to write C# code that uses the DTE API to generate a Visual Studio solution with a set of cpp (vcxproj) projects. I can create the sln and vcxproj files ok, using a vcxproj template (from the VS 2017 samples). But when I try to [...] read more
c#
visual-studio
envdte
dllregistration
0votes
0answers

Integrating Skype for Business 2016 and MS Unified Service Desk (Dynamics 365)

I am working with MS Dynamics 365 CRM and Unified Service Desk (v2.2.2.815). Our organization uses Skype for Business 2016 (v. 16.0.7726.1049). I have been tasked with integrating SfB and Unified Service Desk. In other words if a Skype incoming call is detected perform X action in USD. My understanding [...] read more
dynamics-crm
crm
skype-for-business
skypedeveloper
unified-service-desk
0votes
1answer

DCOM CoCreateInstanceEx 0x80040155

DCOM client is situated under WIN server 2012, DCOM server is located under WIN XP. When I call CoCreateInstanceEx it returns 0x80040155 "Interface not registered". Actions that were already performed: * Register COM classes on the serverside via MyApp.exe /regserver * Checked the registry (on server side) if the appropriate [...] read more
c++
dcom
0votes
0answers

unhandled exception of type 'System.InvalidCastException'

> Unable to cast COM object of type > 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type > 'Microsoft.Office.Interop.Excel._Application'. This operation failed because > the QueryInterface call on the COM component for the interface with IID > '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: > Interface not registered (Exception from HRESULT: 0x80040155). The error [...] read more
c#
excel
interop
office-interop
0votes
1answer

Outlook 2010 COM hresult: 0x80040155 Exception on c# app, but only on my Workstation

We have a c#-4.0 Click Once WinForm application with a DataGrid that displays a list of .msg files that have been saved on our file server, and when the user double clicks on a row in the grid, it opens the corresponding .msg file. This app is deployed to over [...] read more
c#-4.0
com
interop
office-interop
outlook-2010
0votes
0answers

COM Error trying to create Excel.Application object

Working from Visual Studio 2013 to create a new program involving excel. Done this before in earliere excel versions, but cannot get it to work now. Trying to create the excel application object throws an error (however an excel process is started when I look in the task manager). We're [...] read more
vb.net
visual-studio-2013
excel-2016
0votes
1answer

Serialising a label object with .Net Json

I am trying to serialise an object using json.Net but I am getting the following exception. Newtonsoft.Json.JsonSerializationException: Error getting value from 'Parent' on 'System.Windows.Forms.Label+LabelAccessibleObject'. ---> System.Runtime.InteropServices.COMException: Interface not registered (Exception from HRESULT: 0x80040155) at Accessibility.IAccessible.get_accParent() at System.Windows.Forms.AccessibleObject.get_Parent() at System.Windows.Forms.Control.ControlAccessibleObject.get_Parent() at GetParent(Object ) at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target) Here is the code I [...] read more
c#
.net
winforms
serialization
json.net
0votes
1answer

Windows Runtime (WP 8) out of process component and raising / subscription events

I've made out-of-process WR/WP8 component with own background thread. It handles SIP stack internally and runs in background thread. It is modified code from ChatterBox MSDN example. https://code.msdn.microsoft.com/windowsapps/ChatterBox-VoIP-sample-app-b1e63b8b Last days I add delegates to raise events from component. In C++/CX it is: public delegate void OnLogMessage(Platform::String^ msg); public ref class [...] read more
c++
events
windows-phone-8
out-of-process
0votes
1answer

.net & Excel - From Office 2007 to 2013

so, our IT department upgraded everybody from Office 2007 to Office 2013, and many of my hard work has to be redone. (VS 2013 Express, framework 4.5) The error I am getting is: "Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel.Range'. This operation failed because the [...] read more
.net
excel
office-interop
office-2007
office-2013
0votes
1answer

DirectShowNet - Error when recreating graph for webcam after unplug/replug back in

I've spent almost 4 hours trying to figure out a solution for this issue. Basically, I am writing an application in C# using DirectShowNet that shows video from a webcam, allows you to take snapshots, and change resolution of the webcam. I have a device manager that detects when a [...] read more
c#
com
webcam
directshow
directshow.net
0votes
0answers

C# How to read/update activex combobox from an Excel Macro-Enabled Workbook file (xlsm)

I am currently developing a C# application that opens, reads and updates an Excel Macro-Enabled Workbook file (xlsm). I was able to read and update cells but I was not able to read/update an ActiveX Control, specifically a Combobox. > using Excel = Microsoft.Office.Interop.Excel; > > using MSForm = Microsoft.Vbe.Interop.Forms; [...] read more
c#
excel
com
interop
activex
0votes
1answer

An exception of type 'System.Runtime.InteropServices.COMException' occured. Interface not registered (Exception from HRESULT: 0x80040155)

I am trying to use a COM Object from a different thread and I am getting this error. The same error does not happen in Single threaded model. What could be the possible reason? I tried implementing the interfaces with CComMultiThreadModel. Still no luck. read more
multithreading
com
0votes
1answer

Interface not registered(0x80040155) when running Pex On Specific machine

PEX 0.94.0.0 RELEASE VISUAL STUDIO 10.0.40219.1 BUG REPORT How to reproduce: 1. Open a class library project 2. Create an empty method 3. Right Click->Run Pex I run without problem on another machine (In Office, VS2010 Utimate) But I got this exception on my home computer(VS2010 Professtional) -------------------------------------------------------------------------------- exception details: [...] read more
visual-studio-2010
pex
-1votes
1answer

How do I set Task or Thread privileges?

How do I set Task or Thread privileges ? I ask because I use Task Scheduler Managed Wrapper and when I call it in another thread (that apparently has lower privileges) I get exception. I saw this SO question, but didn't manage to use it successfully (Thread.CurrentPrincipal.Identity as WindowsIdentity is [...] read more
c#
multithreading
task-parallel-library

Comments

Leave a comment

(plain text only)

Sources

  1. winerror.h from Windows SDK 10.0.14393.0
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0