Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 8th, 2004, 08:57 AM
Authorized User
 
Join Date: Feb 2004
Location: Sofia, , Bulgaria.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default COM component with C#

Hi,

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.
Alex

Reply With Quote
  #2 (permalink)  
Old October 11th, 2004, 01:21 PM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I don't think this can be done.

Hal Levy
I am here to help you, not do it for you.
Reply With Quote
  #3 (permalink)  
Old October 11th, 2004, 11:58 PM
Friend of Wrox
 
Join Date: Feb 2004
Location: Bangalore, Karnataka, India.
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4 (permalink)  
Old November 5th, 2004, 04:10 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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."

http://msdn.microsoft.com/library/de...lregasmexe.asp


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:

http://msdn.microsoft.com/library/de...rtlbexpexe.asp
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:24 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.