hresult

Open Excel 2016 file failed with HRESULT: 0x800706BE

倖福魔咒の 提交于 2021-01-27 19:58:19
问题 The simple VB.NET code for opening up an existing Excel file consistently failed at open command with the following error: The remote procedure call failed. (Exception from HRESULT: 0x800706BE) I've searched Stack Overflow and Microsoft sites for this error, it looks like no one has a definitive answer. But one thing consistent seems to be all happens with 64bit Excel. Anyway, I am here asking for help with this problem. Below is my very simple code: Imports Microsoft.Office.Interop.Excel Dim

NinjectControllerFactory FileLoadException Error

谁说胖子不能爱 提交于 2020-01-06 15:19:09
问题 I tried create just example porject and I want use Ninject.I create NinjectControllerFactory.cs like this using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Ninject; using System.Web.Routing; using Moq; using System.Linq; using SportStore.Domain.Entities; using SportStore.Domain.Abstract; using System.Collections.Generic; using SportStore.Domain.Concrete; namespace SportStore.WebUI.Infrastructure { public class

Could QueryInterface() provide us with nullptr when succeed? [duplicate]

你离开我真会死。 提交于 2019-12-24 11:26:58
问题 This question already has answers here : Handling CoCreateInstance return value (2 answers) Closed 5 years ago . Imagine a situation: CComPtr<IGraphBuilder> pGraph; HRESULT hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pGraph)); if (SUCCEEDED(hr)) { CComPtr<IMediaControl> pControl; hr = pGraph->QueryInterface(IID_PPV_ARGS(&pControl)); if(SUCCEEDED(hr)) {...} } I wonder, if pControl could ever be nullptr inside last block {...} . The question occurred,

What causes CORDBG_E_CLASS_NOT_LOADED (HRESULT: 0x80131303)

前提是你 提交于 2019-12-24 00:56:35
问题 While attempting to debug an application, I keep noticing that two of my arrays and one of my lists seems to be mysteriously... Not there. The error given for that (upon pausing the application and looking through my compiler's variable list) is "A class is not loaded HRESULT: 0x80131303". After googling, I found out that that particular HRESULT is named "CORDBG_E_CLASS_NOT_LOADED", however I found nothing about it's possible cause, or how to solve it. I would normally paste the relevant code

What causes CORDBG_E_CLASS_NOT_LOADED (HRESULT: 0x80131303)

痴心易碎 提交于 2019-12-24 00:54:00
问题 While attempting to debug an application, I keep noticing that two of my arrays and one of my lists seems to be mysteriously... Not there. The error given for that (upon pausing the application and looking through my compiler's variable list) is "A class is not loaded HRESULT: 0x80131303". After googling, I found out that that particular HRESULT is named "CORDBG_E_CLASS_NOT_LOADED", however I found nothing about it's possible cause, or how to solve it. I would normally paste the relevant code

In Windows, is there any way to convert an errno into an HRESULT?

筅森魡賤 提交于 2019-12-22 05:28:12
问题 I know the HRESULT_FROM_WIN32 macro to convert a Win32 error code into an HRESULT, is there any way to do the conversion starting from an errno error? 回答1: In short, no. As of http://msdn.microsoft.com/en-us/library/5814770t%28v=vs.100%29.aspx The errno values are constants assigned to errno in the event of various error conditions. ERRNO.H contains the definitions of the errno values. However, not all the definitions given in ERRNO.H are used in 32-bit Windows operating systems. Some of the

How to distinguish programmatically between different IOExceptions?

北城余情 提交于 2019-12-22 04:09:26
问题 I am doing some exception handling for code which is writing to the StandardInput stream of a Process object. The Process is kind of like the unix head command; it reads only part of it's input stream. When the process dies, the writing thread fails with: IOException The pipe has been ended. (Exception from HRESULT: 0x8007006D) I would like to catch this exception and let it fail gracefully, since this is expected behavior. However, it's not obvious to me how this can robustly be

How to handle WinRT exceptions that result in Exception?

只谈情不闲聊 提交于 2019-12-21 01:59:27
问题 If a Windows runtime type raises a COM error .NET seems to wrap this error often (or always?) just into an Exception instance. The error message includes the COM HRESULT error code. When using the new Cryptographic API with AES-CBC for example a wrong buffer length results in an Exception with the message "The supplied user buffer is not valid for the requested operation. ( Exception from HRESULT: 0x800706F8 )". Well, How are we supposed to handle those exceptions? Should we read the HRESULT

Handling CoCreateInstance return value

五迷三道 提交于 2019-12-19 23:26:28
问题 Here's a code sample creating a COM object: CComPtr<IBaseFilter> pFilter; auto hr = CoCreateInstance(CLSID_DMOWrapperFilter, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, reinterpret_cast<void**>(&pFilter)); I've seen somewhere that checking if CoCreateInstance() succeeded should look like this: if (SUCCEEDED(hr) && pFilter != nullptr) { // code goes here } What if I would check only hr ? Wouldn't it be enough? Should I also check that filter != nullptr ? //would this be enough? if (SUCCEEDED

How do I determine the HResult for a System.IO.IOException?

我只是一个虾纸丫 提交于 2019-12-17 09:19:15
问题 The System.Exception.HResult property is protected. How can I peek inside an exception and get the HResult without resorting to reflection or other ugly hacks? Here's the situation: I want to write a backup tool, which opens and reads files on a system. I open the file with FileAccess.Read and FileShare.ReadWrite, according to this guidance, because I don't care if the file is open for writing at the time I read it. In some cases, when a file I am reading is open by another app, the System.IO