com

Outlook Com Add-In Deployment & Extensibility Issue

你离开我真会死。 提交于 2019-12-11 14:18:37
问题 I'm a developer writing an add-in for Outlook2003/2007 using C#, Visual Studio 2005. I'm also using the COM add-in wizard (not using VSTO, I have a Connect.cs). The program successfully runs with visual studio installed on my machine but when I try to deploy the software I am getting weird behavior. I have a logging system set up to write a few Extensibility.IDTExtensibility2 events (OnBeginShutdown, OnDisconnection, OnConnection, and OnStartupComplete) to a log file. When I run Outlook on

Does Xamarin support COM?

孤者浪人 提交于 2019-12-11 14:17:09
问题 Does the MonoProject or Xamarin studio support Microsoft's COM technology? Was wondering if I could use the ole32.dll in mono. I can already use some dll's for .net, but I get a not found exception when using others that rely on ole32.dll. 回答1: No. Mono 1.0 and Mono 1.1.xx do not have support for COM, it is a known missing feature of Mono. Initial work has begun on supporting MS COM on Windows. The long term goal is to support a variety of unmanaged component technologies including MS COM,

Microsoft C++ exception: _com_error at memory location

谁说胖子不能爱 提交于 2019-12-11 14:13:21
问题 I have created a COM dll in .Net and build it under Any CPU. I am using that COM dll in Vcpp code but getting Microsoft C++ exception: _com_error at memory location error when creating the pointer reference to COM class. The VCPP code works perfectly fine if the Build configuration is Win32 but if i change the configuration to X64 mode then teh application crashes. Please Help 回答1: Since you're using a so-called in process DLL, you have to use the 64 bits version of that DLL in your program.

Excel process won't quit after COM automation

允我心安 提交于 2019-12-11 13:52:33
问题 I need to automate a specific version of Excel (2003), independent of the default version installed on the target machine. For this purpose, I am using the following steps: launch Excel by supplying the desired executable to CreateProcess find the main and accessible window with EnumWindows and EnumChildWindows use AccessibleObjectFromWindow to get an object from the Excel object model do the automation stuff through COM smart pointers This all works fine, but the Excel process will not

Optimising Method Calls on Dynamic Type

假装没事ソ 提交于 2019-12-11 13:46:19
问题 I have the following code that instantiates a registered COM object private dynamic server = null // Global variable. ... Type type = Type.GetTypeFromProgID("Svr.GrpCall"); this.server = Activator.CreateInstance(type); I can invoke methods from this COM/ dynamic object just fine using very intuitive notation string expectedResult = this.server.GroupInit(someString, someBoolean); For single calls the performance of calling such methods through the Dynamic Language Runtime (DLR) is liveable.

Security Exception while use FileSystemObject in C#

拈花ヽ惹草 提交于 2019-12-11 13:39:17
问题 I want to write a fast disk usage detect program, and found that FileSystemObject is the fastest way to do this. And FileSystemObject is in COM -> Microsoft Scripting Runtime . All the code is simple, and I parsed here. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DiskUsage { class Program { const string FolderPath = @"C:\Windows\System32"; static void Main(string[] args) { var startTime = DateTime.Now; Scripting

IHTMLElement -> IAccessible

旧时模样 提交于 2019-12-11 13:13:20
问题 How to get IAccessible from IHTMLElement? I have receive "Interface is not support" error. 回答1: Not all HTML elements are accessible. See Accessible HTML Elements (there's also a list of accessible elements below). You might have hit an element that is not meant to be accessible. 回答2: Use IServiceProvider::QueryService - full details at this article. Basic idea is that QueryService is like a less strict version of QI: QI requires that all the interfaces are part of the same COM object and

Excel type library / Delphi 2009/ bad variable type

一笑奈何 提交于 2019-12-11 13:07:11
问题 We have just updated an application which uses the Excel type library to Delphi 2009 from Delphi 2006. What I am finding is that nearly nothing now works - nearly any call to Excel results in a message "Bad variable type.". For example we may do: Sheet.Cells.Item[Row, Column].Value := Value where Sheet is an ExcelWorksheet and Value is a Variant. The next thing we see in the stack is a call to _DispInvoke in Variants, and then on into ComObj. What am I doing wrong? 回答1: I can advise you to

How to edit cell value in VB.net - Using .Interop.Excel

有些话、适合烂在心里 提交于 2019-12-11 12:59:02
问题 This is a simple question. I have this code: CurrentRow = 3 MyColumn = 2 CurrentCell = (CurrentRow & "," & MyColumn) WorkingSheet.Cells(CurrentCell).value = (ClientName & " " & "(" & ClientLocation & ")" & " " & ExtraDefinition) I thought that this would place the data on the 'WorkingSheet' in the position "B3" but it places the data in the cell "AF1". Why is this? Thanks, Josh 回答1: Cell is not expected to be used as you are using it; you have to input the row and column indices (as integers)

Connect to COM events in C# - support both managed and unmanaged servers

无人久伴 提交于 2019-12-11 12:48:16
问题 I'm writing C# code that needs to connect to COM events. I implemented the use of IConnectionPointContainer and IConnectionPoint thus: IConnectionPointContainer connectionPointContainer = internalGenerator as IConnectionPointContainer; if (connectionPointContainer == null) { Debug.Fail("The script generator doesn't support the required interface - IConnectionPointContainer"); throw new InvalidCastException("The script generator doesn't support the required interface -