Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 8th, 2004, 08:57 AM
Authorized User
Join Date: Feb 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default COM component with C#


i have the following question:

Can I create a normal COM component with C#, which to register in Windows and use like, lets say COM component created with VB6, instantiating objects with CreateObject() in other Environments like VBA for example? Or add it as a Reference to VBA, or VB6 projects?

Because the .dll that i produced with .NET & C# is one i can add to another .NET project, but i can't add it to VBA as a reference neither can i register it in Windows, so i can use CreateObject().

Thanks in advance.

Old October 11th, 2004, 01:21 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts

I don't think this can be done.

Hal Levy
I am here to help you, not do it for you.
Old October 11th, 2004, 11:58 PM
Friend of Wrox
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts

Yes I think if you create a Component in C# it will require .NET Framework, so while running that component you need Framework without that you cannot run. So it is not possible I think.

It is not how much we do,
but how much love we put in the doing.

-Mother Theresa
Old November 5th, 2004, 04:10 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

You can use a .NET assembly in COM. There is a setting in the project properties to register the assembly for COM interop. Of course, as mentioned, you must still have the .NET framework on the machine because the underlying code is still managed .NET code.

Property Properties -> Configuration Properties -> Build -> Register for COM Interop

You can perform this manually with the Assembly Registration Tool (Regasm.exe) found in the framework directory. Here's what MSDN says:

"The Assembly Registration tool reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently. Once a class is registered, any COM client can use it as though the class were a COM class."


Also, if that doesn't get you what you need, you can use the Type Library Exporter (Tlbexp.exe) found in the Visual Studio SDK to create a COM consumable type library. Take a look at MSDN for more details:


Similar Threads
Thread Thread Starter Forum Replies Last Post
web component? RoniR ASP.NET 1.0 and 1.1 Professional 3 June 11th, 2007 05:14 AM
How can i update my component anujrathi ASP.NET 1.0 and 1.1 Professional 0 June 15th, 2006 10:42 PM
window component madhava_ram Flash (all versions) 2 February 18th, 2005 05:48 AM
Email Component vikasp2p General .NET 1 September 22nd, 2004 09:19 AM
Is there such a component? SqUaRe48 Classic ASP Components 0 July 12th, 2003 12:04 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.