com

How to use a C++ class library in a .net project

My .net project needs to use a third party class library written in C++. I have already tried directly adding a reference to this DLL from the project's context menu 'Add a refence...'' but it did not work as I assume this DLL does not implement the COM object model. What options do I have now? Some suggest to create a .net wrapper aro...

Function written in Delphi2010 COM object not visible in C# .net

Hi, I wrote a function in Delphi 2010 COM object. This function will return string using PChar. I tried to use the COM object in C# .net. So, i added the reference to the COM DLL in my C#. NET application. I found out that the function is not visible in the References explorer list, whereas the other functions which i wrote earlier a...

Adding an in-proc COM Server object to a C# application

I am new to COM and need to add a Server COM object to my c# application so I can call its methods and implement events. The documentation I have says this requires a COM-aware language such as Visual C++. My app is written in C# so I'm not sure how this is going to work. Any direction would be appreciated. I am writing an app that c...

Hide Member Without Using Underscore

I have a class written in VB.Net exposed to COM via the ComClass & ComVisible attributes. The class is then made available to VBA via a TLB. In VB6 you could easily mark a member hidden in the object browser but still available with a check mark. In VB.Net the only way I found to make a member hidden the VBA object browser is to prefixin...

What are limitations of side-by-side COM?

We need to adapt our application to be usable through ClickOnce. The application consists of a .exe file, and a huge set of Visual C++ libraries, some of them are in-proc COM servers used by other libraries. Currently our installer does regsvr32 to register the COM servers, but looks like ClickOnce applications are not allowed to modify...

Merging two .IDL files or two .tlb files into one file.

Hi all, I have 2 .net dll's which I expose to COM using REGASM. In order to simplify referencing within a COM client I would like to make these into one file. I have tried converting both files to IDL and then copying the contents of the Library section of one into the other and then compiling back to .tlb with MIDL. This works fine fo...

Creating COM Component in .NET to override IE functioanlity(custom download manager)

Hello, I have to create a custom download manager that will replace a standard download manager in internet explorer. After googling I've learned that I have to create a COM component that implements IDownloadManager interface. As far as I understand I have to create a dll, generate guid for it and register it using regasm.exe utility,...

Register 32 bit COM DLL to 64 bit Windows 7

Hi, I have a 32 bit Com Component DLL and this DLL is written by Delphi. Its a WIN32 DLL. I want to use this DLL in my Visual C# project on .NET platform. I cant add referance this DLL to project. I try to register in Command Prompt as Administrator in Windows 7 OS but ı get this error. "Check if the module is compatible with an x86 (...

Can a VBA application Listen for events in a .NET class library through COM?

I have a class library that i made in C#.NET. The class has a public event, public event EventHandler DataReadyEvent; that is triggered periodically. I have a VBA application that creates an instance of this Class Library using CreateObject(...). I can access the methods and properties of the class library easially through COM but I can...

VSTO Excel Com Add In Ribbon Not Loading

I'm using VS 2010 to develop an Excel 2007 COM Add-In. Because it's a VS 2010 Office Project, it targets the .NET 4.0 Client Framework. I've added a new Ribbon (XML) item called MyRibbon, so default filenames of ThisAddIn.cs, MyRibbon.cs, and MyRibbon.xml. Everything builds fine. It publishes with a .vsto extension. When I install the a...

Excel Reference COM vs .NET

What is the difference between adding a reference to Excel 11.0 from .NET vs COM? (In C# if that even matters) -Edit- To clarify, I am talking about the .NET and COM tabs in the Add Reference dialog, thanks for pointing that out Hans Passant. ...

Invalid procedure calling .NET DLL method via COM in Classic ASP

Hi, When I try to run some VB6 code, I get the following error: Microsoft VBScript runtime error: Invalid procedure call or argument: 'stx.ResolveAddress' However, in the code below, if I do NOT set the return to "stx.ResolveAddress" to a variable, I do NOT get the above error. Set stx = CreateObject("MyApp.Api.Wse3.STxTransactionS...

Delphi Error E1026 File not found: "myprojectname.tlb"

I have a project let's call it Yellow.dproj, which I saved as Blue.dproj, to make some changes. There must be some COM/DCOM related code in this project, but I can't figure out where. The error I am getting when I try to build Yellow.dproj is that it can not find a type library (TLB) file: "E1026 File not found: ". The file it can't ...

Mocking COM Interfaces using Rhino Mocks

I have a COM library that I have to reference in my app and I am trying to mock its interfaces. I am getting exceptions when I am doing this MockRepository.GenerateMock<IAmAComInterface>(); I don't get exceptions when I do this: MockRepository.GenerateDynamicMockWithRemoting<IAmAComInterface>(); but none of my expectations are verifyin...

associative array from javascript to activex object

I need to pass an associative array from Javascript to a C++ activex control in IE6+. It seems a shame to write my own type for something so standard. It doesn't have to work with native JS objects, I can use a custom associative array type if I need. I've been googling for a couple days and there isn't a lot of information on this subj...

How could HRESULT appear in an MIDL file?

Hi guys! I am developing some COM interfaces with IDL files. Some interface methods return HRESULT, but I have checked the MIDL language reference on MSDN, there's not a clue of HRESULT. So where could I find the official definition of this data type? Update Thanks to Shog9, I found it in wtypes.idl. I paste it here for other's view: ...

Interop (vb6 dll used in .NET 4.0) from assembly hangs

Hi all, we have an old vb6 DLL that we wish to use in c# .NET 4.0. The dll should reside in a separate thread, so that we can invoke methods from anywhere (initialization is very slow). The thread is STA, declared in a given assembly, referenced by other assemblies (loaded as modules using PRISM framework) When the thread tries to crea...

Interprocess communication between a 2 applications.

Hi, I would like to transfer information between 2 process and the data that I pass between these 2 processes are COM visible types. What is the best way I can use to transfer information between these to processes. I know, we could do it using Named Pipes but not sure if we could transfer types using this. Can someone suggest me to a g...

How to make a COM in language other than C/C++?

I noticed that MIDL.exe only generates header file (*_h.h) and GUID file (*_i.c) for C/C++. Which facilitates creating COM in C/C++. What if I want to create COM in VB or some other language? IMO, I must define the interface in MIDL language first, and then compile it with MIDL.exe. So how could other languages utilize the output of MI...

Comparison of oleautomation compatible data types and CTS.

When we define a COM interface in MIDL (Microsoft Interface Decription Language), we should utilize the oleautomation compatible data types. These types could be recognized by the COM aware languages. Suddenly, the .NET CTS (Common Type Specification) flashed into my mind. The CTS is the minimum subset of types that any .NET compatible ...