com-interop

Extending C++ Win32 application with a C# WPF component

Hello, I need to add a new component to a C++ Win32 application (no CLR support) and I would like to implement the new component in C# and use WPF. This new component is basically a window with some controls, which I need to launch quickly from an option in the menu of the Win32 application. The new component and the existing applicatio...

Interop marshaling of VT_RECORD VARIANTs with side-by-side deployment, is it possible?

Hi All, Here is my problem, we have a VB.NET application that talks to ATL COM dlls. Some of the COM interface function parameters are VARIANTs that contain UDTs (VT_RECORD) and they need to be marshaled back and forth between COM and .NET. Registering the COM type library, creating HKCR\Record keys and putting a PIA in the GAC has been...

C# + COM, modify array in parameter

I have a COM object in C# and a Silverlight application(escalated privileges) which is a client to this COM object. COM object: [ComVisible(true)] public interface IProxy { void Test(int[] integers); } [ComVisible(true)] [ClassInterface(ClassInterfaceType.None)] public class Proxy : IProxy { [ComVisible(true)] public void ...

What is the Guid attribute that appears above classes in C#?

Hi. I've picked up some C# code recently and one of the classes has a Guid attribute present above it. I don't understand what this is or what it's used for. Can someone give me a rundown of what it is, or just point me in the direction of some articles that give more information about this? Thanks! ...

Is there any difference between Interop.AZROLESLib and Microsoft.Interop.Security.AzRoles?

Microsoft provide the Microsoft.Interop.Security.AzRoles interop library in Server 2003 for AzMan (Authorization Manager). It was built under .NET 1.0. Can anyone tell me if there's a difference between this and creating a reference to the "azroles 1.0 Types Library" (C:\Windows\system32\azroles.dll) which ends up as Interop.AZROLESLib...

Call Win32 DLL from .NET with complex struct

Hello I have upgraded an old VB6 component to .NET. This component made a call to another Win32 component, with the following type structure: Public Type DDPARAMS bAddressFlag As String * 1 bCompanyFlag As String * 1 bNameFlag As String * 1 bPremiseFlag As String ...

VB6 .NET Interop - Performance issue

Hello ! I'm trying to use a VB6 app consumed in a C# app. The VB6 App is a Winform app. To do this, I have modified the VB6 App (EXE) to a DLL. Then I've referenced it in my C# app. In my VB App, I've add a new Class with some methods just to open VB forms. Everything works fine... except that if the form has many controls (30), the wi...

How do I reference objects and methods in a COM .tlb file in VB6?

Background: We have a COM object written in C#. We are working with another company that has code written in VB6. We need to send them VB6 code that creates and calls objects/methods from our COM object. I created a .tlb file from the C# COM DLL file using RegAsm.exe provided by Microsoft. I then added this .tlb file as a reference in V...

.NET database calls slow when using COM Interop, fast via VB6

Hi, After searching couple of days (here and here), I believe I've found the problem and it seems identical to this one. However, I have captured two execution plans to compare it but, they seem to be identical except execution time. (The Database server is SQL SERVER 2000) The Query executed in VB6 : EventClass : SQL:BatchCompleted ...

How to late bind a CLR 4.0 assembly from a 3.5 project?

The title is self-explanatory of what I want to accomplish. I have a COM-visible component built in 3.5 and my new projects are 4.0. Code very similar to the one below is what I want to run from the 3.5 component. Assembly a = Assembly.LoadFrom(@"C:\MyCLR4.exe"); Type t = a.GetType("MyCLR4Class"); object o = Acti...

Is Microsoft.SmartDevice.Connectivity properly COM-registered?

I'm trying to use the Microsoft.SmartDevice.Connectivity library to talk to a windows phone 7 device, but whenever I try to create a DatastoreManager (which is the first step) I get a COMException about guid {250BEABB-55E8-43BB-AC97-2D95674ECE14} (which corresponds to the Microsoft.VisualStudio.DeviceConnectivity.Interop.ConManClass type...

Fastest way to interface between live (unsaved) Excel data and C# objects

Hi, I want to know what the fastest way is of reading and writing data to and from an open Excel workbook to c# objects. The background is that I want to develop a c# application that is used from Excel and uses data held in excel. The business logic will reside in the c# application but the data will reside in an Excel workbook. T...

Avoiding cross process calls when doing Word automation via VB.net

The short version I've got a Word Addin in VB.net and VSTO that exposes a COM compatible object via Word.COMAddins.Object, so that the addin functionality can be called External to Word, without accesses to Word itself being cross-process. The technique worked in VB6, but with VB.net, it still works, but it's much slower than the same c...

RegistrationServices.RegisterAssembly error - help!

I have an assembly on a shared folder (UNC-path only, no mapped drive). When I try to register it programmatically via RegistrationServices, I'm getting a strange error. Here's the code: using System; using System.IO; using System.Reflection; using System.Runtime.InteropServices; namespace BLRegisterAssembly { public static class...

Call method in existing Com Application from my .NET application

There is a scenario I'm interested in. User runs COM based application in a separate window, I want my C# application to manipulate that application through COM calls. I've found COM interface I'm interested in and VisualStudio has successfully generated wrapper (MyApp.interop). So I can write something like new Interop.MyApplication() ...

Marshalling a C# Dictionary over COM interop to C++

Is there a good way of marshalling a Dictionary<string, string> over COM interop? Ideas so far include tokenising each KeyPair to an array of strings which can be marshalled as a SafeArray, or having two string arrays containing keys and values. Neither seems particularly satisfactory. Any ideas? ...

Strange COM behaviour called from .net

i am working on an application which calls the COM component of a partner's application. Ours is .Net, theirs isn't. I don't know much about COM; I know that the component we're calling is late-bound i.e. obj As Object = CreateObject("THIRDPARTY.ThirdPartyObject") We then call a method on this COM object (Option Strict Off in the head ...

How can I pass an instance of a .NET COM object from Delphi to another .NET COM object?

I have a legacy app written in Delphi 7. We are adding new modules to the app. The modules are written in Visual Studio 2010, .NET 4, C#, and exposed to the app through COM. I have successfully defined a class, registered the assembly, exported the type library, imported the type library into Delphi, created the COM client in Delphi a...

COM Interoperability with .Net - missing methods/properties

I have a .Net asm with several interfaces and classes exposed to COM using the [ComVisible(true)] attribute. I generate a tlb, then reference this in my StdAdx file within a C++ COM component. What's odd is that for some reason, even though the very basic intellisense (VS6 for C++) is able to see my properties and methods, I get compil...

COM-Interop: Change .NET Framework Version from 2.0 to 4.0 - Should I change the Guids also?

I like to migrate a COM-Class from 2.0 to 4.0. Would you recommend also to generate new guids for the classes and a different ProgId? The old Class would not be used anymore. I know I have to re-register the Class, for the new Path of the mscorlib. MS-Access create an instance auf my COM-Server Class with CreateObject and my COM-Object...