Make a com component from C# ?

  • Thread starter Thread starter TT \(Tom Tempelaere\)
  • Start date Start date
T

TT \(Tom Tempelaere\)

Hi,

This may be a strange question. But is it possible to make a component in c#
that exposes a specific com interface (a com component sort of)?

Thanks,
 
Nicholas Paldino said:
Tom,

Absolutely. You have pretty much full control over your COM component
if you choose to implement it in .NET. Check out the section of the
framework documentation titled "Exposing .NET Framework Components to COM",
located at (watch for line wrap):

http://msdn.microsoft.com/library/d.../cpconExposingNETFrameworkComponentsToCOM.asp

Hope this helps.

Nicholas,

Actually I forgot to mention that the interface already exists, and should
remain. It is inside a tlb, and we would like to write a component from c#
that exposes that specific interface. The interface is a dispatch interface.

I didn't find any specific topic in the link that covers this case. Did I
miss it?

Thanks,
 
Tom,

What you want to do is very easy. Quite simply, you use the TLBIMP
utility on the TLB, and it will create an assembly with the interface
definition in it. Once you have that, you can use information in the
article I pointed out (sans the information about creating the interface
definition, as you have it already) to create the implementation.
 
Thanks Nicholas.
---
Cheers,
Tom Tempelaere


Nicholas Paldino said:
Tom,

What you want to do is very easy. Quite simply, you use the TLBIMP
utility on the TLB, and it will create an assembly with the interface
definition in it. Once you have that, you can use information in the
article I pointed out (sans the information about creating the interface
definition, as you have it already) to create the implementation.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

TT (Tom Tempelaere) said:
http://msdn.microsoft.com/library/d.../cpconExposingNETFrameworkComponentsToCOM.asp
Nicholas,

Actually I forgot to mention that the interface already exists, and should
remain. It is inside a tlb, and we would like to write a component from c#
that exposes that specific interface. The interface is a dispatch interface.

I didn't find any specific topic in the link that covers this case. Did I
miss it?

Thanks,
 
Back
Top