com-interop

COMException (0x800401E3): Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE)) with scheduled task

狂风中的少年 提交于 2020-01-02 08:22:47
问题 After searching on the web without success, here's my question. I've a task that i want to schedule to retrieve the attachment of an email from outlook and extract the data. It works fine when I launch the task manually but whenever I try to launch it through a scheduled task it fails with the error : COMException (0x800401E3): Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE)) It occurs when the program tries to retrieve or create an instance of Outlook as follow:

COMException (0x800401E3): Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE)) with scheduled task

不想你离开。 提交于 2020-01-02 08:22:13
问题 After searching on the web without success, here's my question. I've a task that i want to schedule to retrieve the attachment of an email from outlook and extract the data. It works fine when I launch the task manually but whenever I try to launch it through a scheduled task it fails with the error : COMException (0x800401E3): Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE)) It occurs when the program tries to retrieve or create an instance of Outlook as follow:

How to get a reference to Internet Explorer's window handle in .net

假装没事ソ 提交于 2020-01-02 07:20:23
问题 Basically I am trying to get the HWND of an instance of Internet Explorer that I have been automating in C#. SHDocVw.InternetExplorer IE = new SHDocVw.InternetExplorer(); IE.AddressBar = false; IE.MenuBar = false; IE.OnQuit += IE_OnQuit; IE.Visible = true; IE.Navigate2("www.bing.com"); I would like to get a reference to it's window handle for further manipulation, however the only example of how to do this is in C++ and I am not sure how to do something similar in C#. The Example the msdn

Returning Multiple Results (UDT?) From An Interop Call - VB6 <--> VB.NET

耗尽温柔 提交于 2020-01-01 19:47:30
问题 I’d like an Interop user control (VB.NET) to return and to accept multiple values from a get/set call. I assumed a user defined type (UDT), would be the correct way but I keep getting a “Variable uses an Automation type not supported in Visual Basic” from the VB6 compile. How is passing multiple values between an interop control and the VB6 application done? VB.NET (Interop) code, a control with a .NET ListView Structure Employee Dim Firstname As String Dim Lastname As String End Structure …

CLR cannot create .NET-based COM objects in UWP

a 夏天 提交于 2020-01-01 19:46:33
问题 I have created a Class Library (.NET Framework 4.7.1) that implements a Text Service ( ITfTextInputProcessorEx etc.) in TSF, using ComVisible attribute. I registered it using RegistrationServices and it can be successfully recognised by the system as an Input Method (IME) and can be used in most applications, except UWP apps. Using in Win32 app In a Win32 app (the 32-bit notepad.exe for example), here is what happens when I activate my .NET-based TextService (by switching to the IME in the

Signing my assembly with a strong name stops it from working

落花浮王杯 提交于 2020-01-01 08:21:20
问题 A colleague of mine created an assembly in VB.net for use with JScript via COM interop. The assembly used to work fine, but we signed it and now it only seems to work on Windows 7 machines. I've tested 2 Windows 7 machines and 2 Windows Vista machines. When we signed the assembly and we try to instantiate the ActiveX object in JScript, an error is returned with no message and only a number: Error: Error number: -2146234304 A search on Google for the error number didn't return much. If we

Signing my assembly with a strong name stops it from working

烂漫一生 提交于 2020-01-01 08:21:09
问题 A colleague of mine created an assembly in VB.net for use with JScript via COM interop. The assembly used to work fine, but we signed it and now it only seems to work on Windows 7 machines. I've tested 2 Windows 7 machines and 2 Windows Vista machines. When we signed the assembly and we try to instantiate the ActiveX object in JScript, an error is returned with no message and only a number: Error: Error number: -2146234304 A search on Google for the error number didn't return much. If we

Using C#, how do I create a new Visual Studio 2012 Solution programmatically?

那年仲夏 提交于 2020-01-01 05:17:30
问题 I followed this Stack Overflow post regarding how to create a project for VS2010, hoping that it would point me in the correct direction, but it doesn't cover creating a VS2012 project or solution. I also explored using SLNTools, but I don't see how to create a new solution from scratch. Ultimately, I would like to create 3-4 VS2012 projects programmatically and then add them to a solution which is also created programmatically. I attempted a solution based on this Stack Overflow post, but I

How does Visual Studio's debugger/interactive window dump the properties of COM Objects in .NET?

空扰寡人 提交于 2020-01-01 02:46:25
问题 In this related question, I noted that Visual Studio's debugger is able to enumerate the properties of System.__ComObject references, which is "a hidden type used when the wrapper type is ambiguous" -- e.g., the type of object you get when you obtain it from another COM object and don't instantiate it yourself: Additionally, if you simply write a COM object's identifier into the Immediate Window, its properties and values are similarly dumped: Note that this is separate from VS2010's "Dynamic

Does .NET define common HRESULT values? [duplicate]

落花浮王杯 提交于 2019-12-31 04:22:34
问题 This question already has answers here : HRESULT Enumeration C# (4 answers) Closed 4 years ago . I'm creating a COM class in C#, which will be called from unmanaged C++. I want to use ThrowExceptionForHR but I'd rather not have to hard-code HRESULT numeric values. I was expecting there would be some enum of common HRESULT values in .Net somewhere? Put another way, where can I find named symbols which map to HRESULT values to pass into ThrowExceptionForHR ? Update: MS talk about it in this