Making Code Library available to COM & .NET from the same assembly

S

Steve Le Monnier

Using C# I've created a code library of useful functions I use regularly in
..NET projects.

I know if you want to make a DLL available to COM clients, you have to
include an interface and guid ID e.g.

[Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("Tester.HelloWorld")]


The question I have is what impact does creating a single DLL have on .NET
Clients if it contains wrappers to make it COM friendly?
Would it be better to create another DLL to wrapper the .NET functions and
the place the COM attributes in that one instead.

That way I will only have a single code library but two DLL's one with COM
wrappers and one without?

Cheers

Steve Le Monnier
 
W

Willy Denoyette [MVP]

| Using C# I've created a code library of useful functions I use regularly
in
| .NET projects.
|
| I know if you want to make a DLL available to COM clients, you have to
| include an interface and guid ID e.g.
|
| [Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")]
| [ClassInterface(ClassInterfaceType.None)]
| [ProgId("Tester.HelloWorld")]
|
|
| The question I have is what impact does creating a single DLL have on .NET
| Clients if it contains wrappers to make it COM friendly?

What do you mean with "if it contains wrappers ", managed classes don't
'contain' any wrappers whether they are attributed or not. Wrappers (here
CCW's) are only synthesized by the runtime when these classes are
effectively exposed to COM clients, they don't even exist when exposed to
..NET clients .


| Would it be better to create another DLL to wrapper the .NET functions and
| the place the COM attributes in that one instead.
|
Obviously No.


Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top