473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

.NET Class mad available as COM

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
Jan 10 '07 #1
6 1248
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.
"Lou" <lo********@comcast.netwrote in message
news:ee***************@TK2MSFTNGP04.phx.gbl...
>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

Jan 10 '07 #2
Lou
So that would be the .tlb?

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

-Lou

"Scott M." <No****@NoSpam.comwrote in message
news:uj****************@TK2MSFTNGP04.phx.gbl...
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.
"Lou" <lo********@comcast.netwrote in message
news:ee***************@TK2MSFTNGP04.phx.gbl...
>>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


Jan 11 '07 #3
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
"Scott M." <No****@NoSpam.comschreef in bericht
news:uj****************@TK2MSFTNGP04.phx.gbl...
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.
"Lou" <lo********@comcast.netwrote in message
news:ee***************@TK2MSFTNGP04.phx.gbl...
>>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


Jan 11 '07 #4
>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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 11 '07 #5
>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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 11 '07 #6
Mattias ,,

I can`t remember i ever did what is described at the link you provide
i did it like this in the past

http://groups.google.com/group/micro...996d74d250974e
And i could just directly set a refernce to it from VB6

regards

Michel

"Mattias Sjögren" wrote:
>
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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 11 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Reid Priedhorsky | last post by:
Dear group, I'd have a class defined in one module, which descends from another class defined in a different module. I'd like the superclass to be able to access objects defined in the first...
1
by: Sue | last post by:
I have a large training database that contains many records of future training courses. For a course there could be only one class or multiple classes. Where there are multiple classes, each class...
18
by: Elder Hyde | last post by:
Hey all, A class of mine needs to tell the outside world when its buffer is not empty. The problem is that C# seems to force you to put the event-raising code in the base class. To illustrate,...
0
by: Bennett Haselton | last post by:
I've noticed that if you enter the following code in the codebehind page for an .aspx page, it won't compile because the call to Trace.Write() is not valid except in methods of a class derived from...
5
by: huzz | last post by:
I am trying to create instance of class and and call a method of this class that creates a global variable which is available in anywhere in the page.. Here is what i am doing.. but i am getting...
5
by: ffrugone | last post by:
My scenario involves two classes and a database. I have the classes "Broom" and "Closet". I want to use a static method from the "Closet" class to search the database for a matching "Broom". If...
2
by: Jessica | last post by:
I have a base class and a derived class, but I am getting errors when I try to access functions of the derived class. Simplified version of my code is as follows: //////////////// // test2.hh...
4
by: Jonathan Wood | last post by:
I'm building a Web application but this question should be common to all C# applications. When I use a class, and I want to add event handlers or override base class methods, how do I know the...
5
by: JamesO | last post by:
Hello all, Is there a way to make a class private to the namespace so that other classes in the namespace can see and use it but noone outside a namespace can see or use it? Feel free to send...
5
by: Andy B | last post by:
I am trying to figure out how to make an object instance available for all methods of a class. I tried to do something like this: public class test { TheObject Instance = new TheObject();...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.