.NET Class mad available as COM

L

Lou

I have created a .net .dll using the wizard to create a COM class.
Every thing is fine. Here is what I don't understand.
If I import the .tlb file into a VB6 project it all works. However why can't
I
import the actual .dll file?
How do you import the .dll file into a C++ app?

I take it the .dll is not a COM object but has a COM expposed class with it
and thats why
only the .tlb works.
Am I correct?
any insight here might go a long way.

Thanks
-Lou
 
S

Scott M.

Yes, you are correct. When you register a .NET assembly for COM InterOp, a
COM Callable Wrapper (CCW) class is created for your COM code to interact
with. This wrapper, in turn, communicates with the actual .NET assembly.
 
L

Lou

So that would be the .tlb?

how does the dll get registered on a target system, not my development
system?

-Lou
 
M

Michel Posseth [MCP]

Huh ???
Yes, you are correct. When you register a .NET assembly for COM InterOp,
a COM Callable Wrapper (CCW) class is created for your COM code to
interact with. This wrapper, in turn, communicates with the actual .NET
assembly.

Is this new in a version of .net that i not own ?? ( i use VS.Net 2003 PRO
and VS .Net 2005 team system )

I just set a reference to my com capable dll and it just works . a tlb is a
type library and existed already in the pre .Net com days
and is used to code against when you do not want to install the hole
application on the development system ,
The Wrapper that you are talking about is created by .Net if you set a
reference to a pre .Net Com capable class

Steps i take

i just create a com class , register it with regasm , and set a reference
to it from VB6

regards

Michel
 
M

Mattias Sjögren

I have created a .net .dll using the wizard to create a COM class.
Every thing is fine. Here is what I don't understand.
If I import the .tlb file into a VB6 project it all works. However why can't
I import the actual .dll file?

Because the DLL file doesn't contain a typelib resource. You can add
that manually if you want, here's how

How to: Embed Type Libraries as Win32 Resources in .NET-Based
Applications
http://msdn2.microsoft.com/en-us/ww9a897z.aspx

How do you import the .dll file into a C++ app?

With an #import directive.


Mattias
 
M

Mattias Sjögren

Yes, you are correct. When you register a .NET assembly for COM InterOp, a
COM Callable Wrapper (CCW) class is created for your COM code to interact
with. This wrapper, in turn, communicates with the actual .NET assembly.

No, a type library is created. Type libraries contain only metadata
describing the COM types, no code at all. CCWs are objects created at
runtime.


Mattias
 

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