.NET Class mad available as COM

  • Thread starter Thread starter Lou
  • Start date Start date
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
 
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.
 
So that would be the .tlb?

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

-Lou
 
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
 
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
 
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
 
Back
Top