com-interop

WithEvents error sinking a COM event that comes from a .NET component

不打扰是莪最后的温柔 提交于 2019-12-13 01:07:15
问题 I am attempting to raise an event in .NET and have it picked up through COM by a VBA application. This answer has been quite helpful in getting my events to show up properly in the type library. On the VBA side, everything looks legit. I have an object variable declared "WithEvents" ,the IDE lets me add event handlers, and the compiler doesn't complain. However at run-time, when I use New to create the object I get the Run-time error 459: This component doesn't support this set of events.

Replace native C++ COM .dll with .NET COM .dll

╄→尐↘猪︶ㄣ 提交于 2019-12-13 00:05:20
问题 Our customer has old Win32 clients that use a native C++ COM registered .dll that we provide. We want to replace the native .dll with a .NET version. So we've built the .NET dll and COM registered it. We have native C++ test clients that are able to handle the swap from the old .dll to the new, but... it seems we need to recompile them for it to work. Is there some logical reason why we need to recompile the test client, or are we doing something wrong? We cannot require our customer to

Is it possible to debug a COM dll in VS2008?

谁说胖子不能爱 提交于 2019-12-12 16:16:09
问题 This may be a very stupid question. Is it possible to debug a COM dll in VS2008 for which I do not have the source code? The reason I want to do this is I am passing an Array to a COM method and I expect this Array to be populated by the method. However the Array is not being populated. So I want to step into the COM method to see whats happening. is this possible? Below is an example of the code I am using: Array binaryArray = Array.CreateInstance(typeof(sbyte), 896); bool success = photo

Using Wrapper objects to Properly clean up excel interop objects

▼魔方 西西 提交于 2019-12-12 08:24:16
问题 All of these questions: Excel 2007 Hangs When Closing via .NET How to properly clean up Excel interop objects in C# How to properly clean up interop objects in C# struggle with the problem that C# does not release the Excel COM objects properly after using them. There are mainly two directions of working around this issue: Kill the Excel process when Excel is not used anymore. Take care to explicitly assign each COM object used to a variable first and to guarantee that eventually, Marshal

How to expose an enum defined in a COM library via interop as the return type of a c# function

南楼画角 提交于 2019-12-12 08:08:48
问题 Hopefully the question is clear but to pad it out for clarity: I have a VB6 dll that defines an enum that I am referencing in my C# dll. The C# dll defines a CCW in the correct way with an idispatch interface that declares a function who's return type is the enum. When running regasm I get a warning that the enum is not COM visible and so the function is not exported. Since it's defined in my VB6 library I would have thought it is already COM visible since it's defined in a COM dll. I realise

Add an attachment to Bugzilla using XML-RPC in VBA

蓝咒 提交于 2019-12-12 04:44:43
问题 I am currently developing an Excel macro which allows creating Bugs in a Bugzilla instance. After some trial and error this now turns out to work fine. I wanted to enhance the client so that it's also possible to add screenshots to the newly created bug. The environment I'm using is a little bit tricky: I have to use MS Excel for my task. As Excel does not understand XML-RPC, I downloaded an interface DLL (CookComputing.XmlRpcV2.dll from xml-rpc.net) which makes the XML-RPC interface

.Net COM+ from .Net project: System.IO.FileNotFoundException

心已入冬 提交于 2019-12-12 03:22:42
问题 I've written a .Net component that runs in a COM+ application. The component inherits from ServicedComponent and is marked to run as a server process (because I need to maintain static data through activations from multiple consumers). Registration is done using RegAsm.exe: c:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /codebase MyObject.dll The COM+ application was created manually and the component added after creation. If I instantiate my component from PHP the code works as

outlook download email body

旧巷老猫 提交于 2019-12-12 02:09:28
问题 I am creating a program that sends a text message and then depending on the reply I want to perform a specific action. Anyways here is my code: using Microsoft.Office.Interop.Outlook; using Outlook = Microsoft.Office.Interop.Outlook; static void Main() { var outlook = new Microsoft.Office.Interop.Outlook.Application(); // fire event when a new email arives outlook.NewMailEx += new ApplicationEvents_11_NewMailExEventHandler(oApp_NewMailEx); // etc } static void oApp_NewMailEx(string

How to find a COM dll installation working back from the Interop dll

五迷三道 提交于 2019-12-12 02:09:05
问题 I have a project that references a COM dll, and the Interop assembly is available and visible in my project, but I would like to locate the actual COM dll and dependencies, so that I can build a complete deployment package. Short of just searching the registry in Regedit, is there anything else I can do to get a grip on this COM package? 回答1: You'll always end up going to the registry. You can obtain CLSIDs from the interop, by looking for [Guid] attributes on classes. From these, you can

Lotus Domino on 64 bit system: Could not create automation object, error 208

对着背影说爱祢 提交于 2019-12-12 01:42:44
问题 I have created a C# .NET DLL with Release/AnyCPU as per http://www-01.ibm.com/support/docview.wss?uid=swg21230705 and successfully registered it for COM Interop. When I open my 32bit Excel on a 32bit Windows 10, and use the code Private Sub CommandButton1_Click() Dim obj As Variant Set obj = CreateObject("MyTest") MsgBox obj.AppendStr("This is") End Sub it returns the expected values. When I open 32bit Excel on a 64 bit Windows 8.1, and use the same code, it also returns the expected values.