Library tutorials & articles
COM Interoperability in .NET Part 2
Introduction
This article elucidates how to build and install-managed code that will be used from COM applications. A classic COM server is activated using the Service Control Manager (SCM). It looks up numerous information such as CLSIDs, IIDs, ProgIDs etc.
So what is the solution to use the .NET assemblies in the classic COM clients,
These are the steps concerned in the build process are as follows:
- Write and compile the managed code.
- Generate a COM type library (*.tlb) for the assembly using the tlbexp.exe
utility so that allow the COM client to interact with the exposed types.
- Install and register the assembly so that COM SCM to locate it.
- Write and compile the COM code that references types in the assembly.
For demonstration purposes, I have created a .NET component in C# named Calculator. For client side, I have created a Visual Basic (VB) 6.0-based client.
Related articles
Related discussion
-
Problem after strong naming an assembly
by rinkurathor1 (0 replies)
-
Very slow inserts using SqlCommand.ExecuteNonQuery()
by porchelvi (1 replies)
-
VB.net class to connect to sql database
by senol01 (2 replies)
-
how to select item to datagrid from textbox
by chandradev1 (49 replies)
-
Adobe Flex reaches out to .NET developers
by ranganathanmca (1 replies)
Related podcasts
-
CodeCast Episode 4: State of .NET, IE8, ASP.NET MVC, and O'Reilly Media
CodeCast Episode 4: State of .NET, IE8, ASP.NET MVC, and O'Reilly MediaHosts Ken Levy and Markus Egger discuss the new State of .NET events, IE8, ASP.NET MVC, followed by an interview from PDC with two editors from O'Reilly Media. More on ASP.NET MVC can be found at http://asp.net/mvc. Interview...
Related jobs
-
Microsoft .Net Architect
in AMSTERDAM (€50K-€90K per annum) -
Applicatie ontwikkelaar binnen Defensie
in Amsterdam (£50K-£90K per annum) -
Business Analist (Openbaar) Vervoer
in Amsterdam (€50K-€90K per annum) -
Application Engineer (VB, .Net, Java) - Standplaats: Utrecht
in Amsterdam (€50K-€90K per annum)
Events coming up
-
Dec
6
Developing AJAX Web Applications with Castle Monorail
London, United Kingdom
Monorail is the model-view-controller engine of the Castle Project, bringing many of the best ideas of Ruby on Rails to the .NET world. In this talk, David De Florinier and Gojko Adzic show how Monorail makes it easy to develop .NET based AJAX applications, and how to use the Castle Project to build Web 2.0 applications effectively. Come to this session if you are a .NET web developer. Everyone is welcome!
I AM A CHINESE,THIS IS MY FIRST TIME TO VISIT THIS WEB SITE~~~~
I MAJOR IN COMPUTER,SOFTWARE,BEING A SOPHIMORE ,I AM SO DESIRABLE TO MAKE A FRIENDS WITH DIFFERENT COUNTRIES~~~~~
I LIKE SPORTS,ESPECIALLY BASKETBALL,AND MUSIC,PLAYING GUITAR~~~~~~
I LOOK FORWARD TO RECEIVING YOUR MESSAGE,MY EMAIL:CHARLES_ANDREW@163.COM
THANKS ,A FRIEND FROM CHINA
Hello, good news!!!
I just figured out what was missing in what was reported in previous comment.
In the Properties Pages of the .NET project, choosing "Configuration Properties" on the left panel, and then "Build", there is a switch labelled "Register for COM Interop", and of course it has to be set "ON", for all this to work as expected!!!!
Well, let's keep working.!!!!
Be well!!!!!
Hello, G.Gnana Arun:
Hi, good day, greetings from Mexico City.
Well, this post is to commet I just tried your implementation, I created a .NET DLL with VB.NET, then followed the .TLB file, just as you specify in your article, but at the moment of using the library in a VB 6.0 project, using the reference to the .TLB file, as you dictate, just when the object is to be instantiated, I receive a Num 429 error, "ActiveX Object can´t be created". I include here the code for the class in VB.NET:
Public
Class cDotNetUtilsVB60 Public Shared Function IsPositiveInfinity(ByVal pdblNum As Double) As Boolean Dim lnuNumTem As Double Return lnuNumTem.IsPositiveInfinity(pdblNum) End Function Public Shared Function IsNegativeInfinity(ByVal pdblNum As Double) As Boolean Dim lnuNumTem As Double Return lnuNumTem.IsNegativeInfinity(pdblNum) End FunctionEnd
ClassCan you figure out what I'm doing wrong???????
Thanks in advance, be well
Roberto Gutierrez R.
This thread is for discussions of COM Interoperability in .NET Part 2.