interop

COM Interop & Outlook - Make Outlook Visible?

99封情书 提交于 2019-12-23 16:43:26
问题 I'm automating Outlook from a VB.NET program, transferring items into the calendar and contacts at the user's request. It's all working, that isn't the problem; the problem is that automating Outlook like this when it wasn't already open creates a hidden instance. I can perhaps understand how this could be useful, to stop the user closing it down while you're still working on it, but since Outlook appears to force one instance only, if the user tries to inspect the changes made while my

AccessViolationException from System.Windows.Forms, using WinFormsHost in WPF

落爺英雄遲暮 提交于 2019-12-23 16:27:22
问题 I'm facing a nasty issue when developing a WPF/WinForms interop application. I've been trying to resolve this issue for three days, but I'm unable to make any headway. I doubt I can provide enough information to get a resolution, but I'm looking for anyone who could explain what on earth is going on here? The component I am using is AxMapControl (ESRI ArcGIS Engine 9.3.1 SP2), which as far as I know is COM-wrapped native code, exposed as a WinForms control. The component is embedded in our

How can i get Javascript Callback in .Net Blazor?

≡放荡痞女 提交于 2019-12-23 11:49:25
问题 Is there a way to add callback to Javascript and get the result in Blazor? Apart from JS Promises. for example, let say i want to load a file Javascript Code window.readFile = function(filePath, callBack) { var reader = new FileReader(); reader.onload = function (evt) { callBack(evt.target.result); }; reader.readAsText(filePath); } Can i have something like this in Blazor C# // read file content and output result to console void GetFileContent() { JsRuntime.InvokeAsync<object>("readFile",

How can i get Javascript Callback in .Net Blazor?

青春壹個敷衍的年華 提交于 2019-12-23 11:49:11
问题 Is there a way to add callback to Javascript and get the result in Blazor? Apart from JS Promises. for example, let say i want to load a file Javascript Code window.readFile = function(filePath, callBack) { var reader = new FileReader(); reader.onload = function (evt) { callBack(evt.target.result); }; reader.readAsText(filePath); } Can i have something like this in Blazor C# // read file content and output result to console void GetFileContent() { JsRuntime.InvokeAsync<object>("readFile",

Unable to cast COM object of type 'Microsoft.Office.Interop.PowerPoint.ApplicationClass'

你说的曾经没有我的故事 提交于 2019-12-23 10:05:40
问题 Unable to cast COM object of type 'Microsoft.Office.Interop.PowerPoint.ApplicationClass' to interface type 'Microsoft.Office.Interop.PowerPoint._Application' . This operation failed because the QueryInterface call on the COM component for the interface with IID '{91493442-5A91-11CF-8700-00AA0060263B}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)). I am unable to finding solution please any one help in this? 来源: https:

What's the purpose of COM+ library applications?

落花浮王杯 提交于 2019-12-23 09:41:13
问题 When a COM+ application is created the wizard offers to choose between a library and a server application. A server application is activated in a separate process and this can be used to cheaply interop 64-bit consumers with 32-bit in-proc COM components. What's the use of library applications that are activated right in the caller process? Why use them instead of plain old in-proc COM servers? 回答1: There are several: Performance - it is a bit faster as you don't have to go through the

using Windows Script Host

十年热恋 提交于 2019-12-23 09:37:31
问题 I am using windows script host for some kind of installer application and I'm creating shortcuts in start menu with it. This problem came up when I switched to x64 environment (win7 ultimate x64+vs2010) I added a reference to Windows Script Host Object Model (from c:\windows\syswow64\wshom.ocx), it generated Interop.IWshRuntimeLibrary dll. I added 'using IWshRuntimeLibrary;' to my .cs files, but when I tried to create WshShell sh = new WshShellClass(); it throws an exception: Could not load

Windows Search sql - can't access System.Search.QueryFocusedSummary

断了今生、忘了曾经 提交于 2019-12-23 09:33:43
问题 I'm trying to query the Windows Search 4.0 using sql. The property of interest for me is: System.Search.QueryFocusedSummary . I'm trying to read this property from the SystemIndex. I get a "column does not exist" error message. I am able to read other columns such as: System.Search.AutoSummary . I am using the Microsoft Windows Search 3.x SDK download (Windows.Search.Interop.dll) on a Windows 7 operating System and Windows Search 4.0. My query is: SELECT TOP 25 System.QueryFocusedSummary From

Convert object to void* and back?

喜欢而已 提交于 2019-12-23 09:30:04
问题 I'm trying to write a wrapper around a C function that expects a function pointer and arbitrary user data ( void* ). The function pointer I've figured out how to deal with using delegates, but I can't figure out how to convert an object into a void* . I can make it a ref object instead, since that behaves like a pointer AFAIK, but when I try that I get an exception like An invalid VARIANT was detected during a conversion from an unmanaged VARIANT to a managed object. Passing invalid VARIANTs

What is the difference between Microsoft.Office.Interop.* version 12 and 14?

三世轮回 提交于 2019-12-23 09:09:17
问题 I have installed Visual Studio 2010 and Office 2007. When I go to "Add Reference" and search for " Office Interop " I can see that each of the references appear twice with versions 12 and 14. I initially tried version 14 of Microsoft.Office.Interop.Word and did a quick test. Initialise the Application, open a Document, close the Document, quit the Application, and release the COM object. My test was a simple WinForms program in C# 4.0. WINWORD.EXE crashed while closing the document. I