comexception

How to check ErrorCode for REGDB_E_CLASSNOTREG?

那年仲夏 提交于 2019-12-22 11:37:17
问题 try { // call to Com Method } catch (COMException e) { if (e.ErrorCode == 0x80040154) // REGDB_E_CLASSNOTREG. { // handle this error. } } I would like to check if com exception is thrown due to REGDB_E_CLASSNOTREG then handle it. I tried with the code above but it gives warning: Comparison to integral constant is useless; the constant is outside the range of type 'int' I believe this error is due to 0x80040154 is not in Int32 range. Can you suggest any possible solution? or Is there any other

WinrtXamlToolkit - Charting : ComException when use of INotifyPropertyChanged

核能气质少年 提交于 2019-12-13 04:29:08
问题 I'm currently using the line chart (from WinRT XAML Toolkit), and I'm facing a problem : everything goes right, but if my (In)DependentValue which is bound to my LineSeries contains a change notification (INotifyPropertyChanged), the toolkit raise a COMException. I used the last version (1.4.1) of the toolkit from Nuget. My XAML code : <toolkitchart:Chart x:Name="AltitudeChart" Height="200"> <toolkitchart:LineSeries IndependentValueBinding="{Binding Distance}" DependentValueBinding="{Binding

C# > UPnP - COMException: The owner of the PerUser subscription is not logged on to the system specified (Exception from HRESULT: 0x80040210)

笑着哭i 提交于 2019-12-12 18:15:02
问题 I'm trying to communicate with dlna compliant devices using a C#.net application, using the UPnP protocol. I'm using the default Visual studio UPnP library("UPnP 1.0 type library (control point)"). I list all rendering devices using UPNPDeviceFinder.FindByType. All works fine... Now I get the AVTransport service using the function: public UPnPService GetAVTransport(UPnPDevice mediaDevice) { foreach (UPnPService service in mediaDevice.Services) { Debug.Print(service.ServiceTypeIdentifier); if

The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

家住魔仙堡 提交于 2019-12-12 17:20:32
问题 I have an application which opens an Visio file .VSD and copies some jpeg images onto the VSD file. I am using Visio 2013, it works fine with this version but I have another client machine where I have only exe of this application(not complete code base) and has Visio 2010 in that client machine. when I run the application and select the Visio .vsd file, it throw the above subjected error. Struggling to understand whether problem with exe, code, version or dlls? May I know what could be the

401 unauthorized exception while reading data from the document library SharePoint 2010

假装没事ソ 提交于 2019-12-12 02:40:55
问题 We developed a WebPart to read the content of the file in the document library in the SiteCollection. I used the following code to read the content. WebClient wc = new WebClient(); wc.Credentials = CredentialCache.DefaultNetworkCredentials; string documenturl = siteurl+"/" + file.Url.ToString(); content = wc.DownloadData(documenturl);//documenturl is the file path of the document But, i got the following error 401 unathorized exception System.Net.WebException: The remote server returned an

COMException on closing Excel workbook

夙愿已清 提交于 2019-12-11 19:26:22
问题 I'm using Excel = Microsoft.Office.Interop.Excel to write various data to Excel sheets. Excel.Workbook wb = null; Excel.Worksheet ws = null; Excel.Application excelApp = new Excel.Application(); excelApp.Visible = true; try { // Create new workbook wb = (Excel.Workbook)(excelApp.Workbooks.Add(Type.Missing)); ws = wb.ActiveSheet as Excel.Worksheet; // write data ... // Save & Close excelApp.DisplayAlerts = false; // Don't show file dialog for overwrite wb.Close(true, targetFilename, Type

COMException when assigning to Excel.Application.ActivePrinter

与世无争的帅哥 提交于 2019-12-11 09:39:41
问题 I have a function, into which I'm passing an Microsoft.Office.Interop.Excel.Application instance. The function uses Windows' built in Fax printer, or the Microsoft XPS Document Writer, to save the file as a tiff image. However, when I try to assign to the application's ActivePrinter property, a COMException with the following message is thrown: Exception from HRESULT: 0x800A03EC Here's the code: 'Save the current default printer Dim strDefaultPrinter As String = excelApp.ActivePrinter 'Assign

Visual Studio crashes when I debug a project with a certain form open in design mode…“Catastrophic failure”

时光怂恿深爱的人放手 提交于 2019-12-10 20:25:47
问题 As the title says, VS2008 keeps crashing on me whenever I debug a project when a certain form is open. I attached another VS2008 instance to it and found the following exception to be the culprit: System.Runtime.InteropServices.COMException occurred Message="Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))" Source="mscorlib" ErrorCode=-2147418113 StackTrace: at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at

Method 'frames' of object 'JScriptTypeInfo' failed

喜欢而已 提交于 2019-12-10 11:48:34
问题 I am working on automation of internet explorer 9 through excel VBA, it throws an error when I reach on the last line below: Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True ie.navigate "https://example.com/Main.asp" 'delay till readystate is complete Set doc = ie.document Set doc1 = doc.frames(2).document 'here comes the error can anyone please help? 回答1: i Have face the same issue and it got resolved This will work for IE 10+ Set doc = ie.document.frames Set doc1 =

Using Interop.MODI Throws 0x80040154 Exception

倖福魔咒の 提交于 2019-12-09 16:06:24
问题 I am currently trying to implement the Interop.MODI.dll (From Microsoft Office) to use the Image -> Text features it should Provide. But when doing var modi = new MODI.DocumentClass(); I get: "COMException 80040154 with CLSID {40942A6C-1520-4132-BDF8-BDC1F71F547B}". What have I tried to solve that problem? I registered the DLL using the regasm tool: -Problem still exists I tried setting the BuildPlatform to x86: -Problem still exists I use the Visual Studio 2010 Ultimate with Windows 7