Click here to Skip to main content
13,093,944 members (59,449 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am converting an old desktop application that uses 2 ActiveX EXE's. It uses CreateObject() to return a reference to the COM object. This reference is then used to pass in pertinent information to the COM component such as database connection information and call the appropriate fuctions. There is no need to use this in IE. It is only used from this desktop app.

What would be a way to do this in .Net using C#.
Posted 19-Dec-12 6:38am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Right click References, Add Reference
select the COM tab in the dialog box and locate your activeX object - I'll call mine objA for now - and hit Ok. objA should appear in your list of references.

In your code you will need to put
using objA;

Then you can use it like any other object e.g.

objA a = new objA();

When you build your project you will get an additional file called Interop.objA.dll which will need to live in the same folder as your exe

I've successfully used this approach with several legacy VB6 COM DLLs and EXEs - but apologies for any typos!
rshepp 19-Dec-12 15:37pm
These ActiveX EXE's are going to have to be re-written for a number of reasons... The most pressing being that I cannot get them to work on the 2008 Terminal Server that I am trying to get them to work on. I would like to modernize them if at all possible and I am trying to determine the best way to do that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100