473,396 Members | 1,766 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.

What replace COM object in .NET?

Hi,
What is the substitute for COM objects in .NET?
How can I create something similar to com in .net?
Is it still possible?
Thank you

Jul 31 '05 #1
9 3087
WJ

"gulu man" <gu*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi,
What is the substitute for COM objects in .NET?
..Net managed Classes
How can I create something similar to com in .net?
Click here to learn more:
http://msdn.microsoft.com/library/de...nunmancode.asp
Is it still possible?


Yes, just tells your .Net assembly it is OK to call unmanaged codes.

John

Jul 31 '05 #2
It's not really what replaces COM in .NET. .NET is a replacement for COM.
When you make a class in .NET, you have just made a .NET object.
"gulu man" <gu*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi,
What is the substitute for COM objects in .NET?
How can I create something similar to com in .net?
Is it still possible?
Thank you

Jul 31 '05 #3
You can also make COM objects in .NET.

"Scott M." <s-***@nospam.nospam> wrote in message
news:et**************@TK2MSFTNGP12.phx.gbl...
It's not really what replaces COM in .NET. .NET is a replacement for COM.
When you make a class in .NET, you have just made a .NET object.
"gulu man" <gu*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi,
What is the substitute for COM objects in .NET?
How can I create something similar to com in .net?
Is it still possible?
Thank you


Jul 31 '05 #4
Well no, not really. This discussion/debate has raged on for some time now,
but I fall down on the side of: You can not make COM objects in .NET. You
can create a wrapper class (COM Callable Wrapper) that wraps the actual .NET
component up and provides COM based interfaces to the .NET object, but the
object still runs within the context of the CLR.

Similarly, you can't make .NET objects from, say VB 6.0. What you can do is
create another type of wrapper class (a Runtime Callable Wrapper or RCW),
that exposes the COM object to the CLR with .NET interfaces. The COM object
still runs within the context of its own runtime (in VB 6.0's case,
MSVBVM60.dll).


"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:u1**************@TK2MSFTNGP15.phx.gbl...
You can also make COM objects in .NET.

"Scott M." <s-***@nospam.nospam> wrote in message
news:et**************@TK2MSFTNGP12.phx.gbl...
It's not really what replaces COM in .NET. .NET is a replacement for
COM.
When you make a class in .NET, you have just made a .NET object.
"gulu man" <gu*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
> Hi,
> What is the substitute for COM objects in .NET?
> How can I create something similar to com in .net?
>
>
> Is it still possible?
>
>
> Thank you
>



Aug 1 '05 #5
Just to follow up on that:

Objects created in .NET, run within the context of the .NET Framework and
the CLR (Common Language Runtime). These objects are said to be "Managed
Assemblies" because the CLR is responsible for their memory
allocation/de-allocation, the exception throwing and handling of the object,
etc. The CLR is managing the object.

COM objects are said to be "Unmanaged Assemblies" because they are not
managed by the CLR under any circumstances. Their memory
allocation/de-allocation and the handling of throwing and catching
exceptions as well as the normal processing of their code is NOT managed by
the CLR.

Regardless of whether you use a COM object in .NET or a .NET object in COM,
the object will remain managed or unmanaged depending on what architecture
it was created in.

"Scott M." <s-***@nospam.nospam> wrote in message
news:ek***************@TK2MSFTNGP09.phx.gbl...
Well no, not really. This discussion/debate has raged on for some time
now, but I fall down on the side of: You can not make COM objects in
.NET. You can create a wrapper class (COM Callable Wrapper) that wraps
the actual .NET component up and provides COM based interfaces to the .NET
object, but the object still runs within the context of the CLR.

Similarly, you can't make .NET objects from, say VB 6.0. What you can do
is create another type of wrapper class (a Runtime Callable Wrapper or
RCW), that exposes the COM object to the CLR with .NET interfaces. The
COM object still runs within the context of its own runtime (in VB 6.0's
case, MSVBVM60.dll).


"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:u1**************@TK2MSFTNGP15.phx.gbl...
You can also make COM objects in .NET.

"Scott M." <s-***@nospam.nospam> wrote in message
news:et**************@TK2MSFTNGP12.phx.gbl...
It's not really what replaces COM in .NET. .NET is a replacement for
COM.
When you make a class in .NET, you have just made a .NET object.
"gulu man" <gu*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
> Hi,
> What is the substitute for COM objects in .NET?
> How can I create something similar to com in .net?
>
>
> Is it still possible?
>
>
> Thank you
>



Aug 1 '05 #6
Interesting perspective. What is a COM object then? What is the difference
between creating COM object in VB6 or C++ and creating a wrapper in .NET?
The COM specification does not discuss implementation but rather then
interface for accessing the methods of some code library. It just accesses
the actual binary code through the use of fucntion tables, right?
"Scott M." <s-***@nospam.nospam> wrote in message
news:ek*************@TK2MSFTNGP09.phx.gbl...
Well no, not really. This discussion/debate has raged on for some time now, but I fall down on the side of: You can not make COM objects in .NET. You can create a wrapper class (COM Callable Wrapper) that wraps the actual ..NET component up and provides COM based interfaces to the .NET object, but the
object still runs within the context of the CLR.

Similarly, you can't make .NET objects from, say VB 6.0. What you can do is create another type of wrapper class (a Runtime Callable Wrapper or RCW),
that exposes the COM object to the CLR with .NET interfaces. The COM object still runs within the context of its own runtime (in VB 6.0's case,
MSVBVM60.dll).


"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:u1**************@TK2MSFTNGP15.phx.gbl...
You can also make COM objects in .NET.

"Scott M." <s-***@nospam.nospam> wrote in message
news:et**************@TK2MSFTNGP12.phx.gbl...
It's not really what replaces COM in .NET. .NET is a replacement for
COM.
When you make a class in .NET, you have just made a .NET object.
"gulu man" <gu*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
> Hi,
> What is the substitute for COM objects in .NET?
> How can I create something similar to com in .net?
>
>
> Is it still possible?
>
>
> Thank you
>



Aug 1 '05 #7
This is why I said this topic has been discussed/debated for some time.

Because COM objects come with so much of their own "baggage" and rules and
..NET components do not come with that same "baggage" and rules and because
COM objects use a different runtime to process their code than .NET objects
do, I would say that a COM object is an object that *natively* exposes the
interfaces specified by the COM architecture. .NET objects do not NATIVELY
expose these interfaces.

Even when you create InterOp wrappers (either a CCW or an RCW), the *actual*
assembly does not change. All you've done is create a new assembly that
wraps the .NET assembly but places COM interfaces around the .NET object(s).
So, the .NET object(s) do not change in any way.


"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:OA**************@TK2MSFTNGP10.phx.gbl...
Interesting perspective. What is a COM object then? What is the
difference
between creating COM object in VB6 or C++ and creating a wrapper in .NET?
The COM specification does not discuss implementation but rather then
interface for accessing the methods of some code library. It just
accesses
the actual binary code through the use of fucntion tables, right?
"Scott M." <s-***@nospam.nospam> wrote in message
news:ek*************@TK2MSFTNGP09.phx.gbl...
Well no, not really. This discussion/debate has raged on for some time

now,
but I fall down on the side of: You can not make COM objects in .NET.

You
can create a wrapper class (COM Callable Wrapper) that wraps the actual

.NET
component up and provides COM based interfaces to the .NET object, but
the
object still runs within the context of the CLR.

Similarly, you can't make .NET objects from, say VB 6.0. What you can do

is
create another type of wrapper class (a Runtime Callable Wrapper or RCW),
that exposes the COM object to the CLR with .NET interfaces. The COM

object
still runs within the context of its own runtime (in VB 6.0's case,
MSVBVM60.dll).


"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:u1**************@TK2MSFTNGP15.phx.gbl...
> You can also make COM objects in .NET.
>
> "Scott M." <s-***@nospam.nospam> wrote in message
> news:et**************@TK2MSFTNGP12.phx.gbl...
>> It's not really what replaces COM in .NET. .NET is a replacement for
>> COM.
>> When you make a class in .NET, you have just made a .NET object.
>>
>>
>> "gulu man" <gu*****@gmail.com> wrote in message
>> news:11**********************@g43g2000cwa.googlegr oups.com...
>> > Hi,
>> > What is the substitute for COM objects in .NET?
>> > How can I create something similar to com in .net?
>> >
>> >
>> > Is it still possible?
>> >
>> >
>> > Thank you
>> >
>>
>>
>
>



Aug 1 '05 #8
Pretty interesting. I think following scenario will explain that nothing in
..NET can replace COM.

I needed to write a outlook add-in which will internally invoke few
webservices. I was preferring to write it as .NET component (as it is
webservices client) but it must implement COM interface IDTExtensibility2.

Now as I understand .NET component can not implement COM interface. So I'll
have to use something like VBA, VB or VC++/ATL, which might invoke .NET
compoenent to access WebServices. Eventually, to keep it simple, I decided
to use VC++/ATL com which itself will invoke WebServices.

Do you agree with this decision?

"Scott M." <s-***@nospam.nospam> wrote in message
news:eP**************@TK2MSFTNGP12.phx.gbl...
This is why I said this topic has been discussed/debated for some time.

Because COM objects come with so much of their own "baggage" and rules and
.NET components do not come with that same "baggage" and rules and because
COM objects use a different runtime to process their code than .NET objects do, I would say that a COM object is an object that *natively* exposes the
interfaces specified by the COM architecture. .NET objects do not NATIVELY expose these interfaces.

Even when you create InterOp wrappers (either a CCW or an RCW), the *actual* assembly does not change. All you've done is create a new assembly that
wraps the .NET assembly but places COM interfaces around the .NET object(s). So, the .NET object(s) do not change in any way.


"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:OA**************@TK2MSFTNGP10.phx.gbl...
Interesting perspective. What is a COM object then? What is the
difference
between creating COM object in VB6 or C++ and creating a wrapper in ..NET? The COM specification does not discuss implementation but rather then
interface for accessing the methods of some code library. It just
accesses
the actual binary code through the use of fucntion tables, right?
"Scott M." <s-***@nospam.nospam> wrote in message
news:ek*************@TK2MSFTNGP09.phx.gbl...
Well no, not really. This discussion/debate has raged on for some time

now,
but I fall down on the side of: You can not make COM objects in .NET.

You
can create a wrapper class (COM Callable Wrapper) that wraps the actual

.NET
component up and provides COM based interfaces to the .NET object, but
the
object still runs within the context of the CLR.

Similarly, you can't make .NET objects from, say VB 6.0. What you can do
is
create another type of wrapper class (a Runtime Callable Wrapper or

RCW), that exposes the COM object to the CLR with .NET interfaces. The COM

object
still runs within the context of its own runtime (in VB 6.0's case,
MSVBVM60.dll).


"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:u1**************@TK2MSFTNGP15.phx.gbl...
> You can also make COM objects in .NET.
>
> "Scott M." <s-***@nospam.nospam> wrote in message
> news:et**************@TK2MSFTNGP12.phx.gbl...
>> It's not really what replaces COM in .NET. .NET is a replacement for >> COM.
>> When you make a class in .NET, you have just made a .NET object.
>>
>>
>> "gulu man" <gu*****@gmail.com> wrote in message
>> news:11**********************@g43g2000cwa.googlegr oups.com...
>> > Hi,
>> > What is the substitute for COM objects in .NET?
>> > How can I create something similar to com in .net?
>> >
>> >
>> > Is it still possible?
>> >
>> >
>> > Thank you
>> >
>>
>>
>
>



Aug 5 '05 #9
No, I don't think you've quite got it. .NET components CAN, in fact, expose
themselves to COM via COM Callable Wrappers (CCW's). In VS .NET, go to the
project's properties and look at the "Build" category of choices. If you
check off "Register for COM InterOp", then when you compile the project, VS
..NET will generate a Type Library file (.tlb) for your .NET component. This
..tlb file is what you will need to make a project reference to from Outlook.

What we've been discussing here is whether the process I've just described
means that .NET can create COM objects. I say, "no", because that .tlb file
is nothing but a wrapper for the native .NET object that will still run
within the context of the CLR (oh yeah, you will need to have your target
machine loaded with the .NET Framework so the .NET component can run).

So, although .NET components can be *exposed* to COM via wrappers, they
remain .NET components because of where their actual code is processed (the
CLR and the .NET Framework).


"Vipul Taneja" <Vi*********@Hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Pretty interesting. I think following scenario will explain that nothing
in
.NET can replace COM.

I needed to write a outlook add-in which will internally invoke few
webservices. I was preferring to write it as .NET component (as it is
webservices client) but it must implement COM interface IDTExtensibility2.

Now as I understand .NET component can not implement COM interface. So
I'll
have to use something like VBA, VB or VC++/ATL, which might invoke .NET
compoenent to access WebServices. Eventually, to keep it simple, I decided
to use VC++/ATL com which itself will invoke WebServices.

Do you agree with this decision?

"Scott M." <s-***@nospam.nospam> wrote in message
news:eP**************@TK2MSFTNGP12.phx.gbl...
This is why I said this topic has been discussed/debated for some time.

Because COM objects come with so much of their own "baggage" and rules
and
.NET components do not come with that same "baggage" and rules and
because
COM objects use a different runtime to process their code than .NET

objects
do, I would say that a COM object is an object that *natively* exposes
the
interfaces specified by the COM architecture. .NET objects do not

NATIVELY
expose these interfaces.

Even when you create InterOp wrappers (either a CCW or an RCW), the

*actual*
assembly does not change. All you've done is create a new assembly that
wraps the .NET assembly but places COM interfaces around the .NET

object(s).
So, the .NET object(s) do not change in any way.


"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:OA**************@TK2MSFTNGP10.phx.gbl...
> Interesting perspective. What is a COM object then? What is the
> difference
> between creating COM object in VB6 or C++ and creating a wrapper in .NET? > The COM specification does not discuss implementation but rather then
> interface for accessing the methods of some code library. It just
> accesses
> the actual binary code through the use of fucntion tables, right?
>
>
> "Scott M." <s-***@nospam.nospam> wrote in message
> news:ek*************@TK2MSFTNGP09.phx.gbl...
>> Well no, not really. This discussion/debate has raged on for some
>> time
> now,
>> but I fall down on the side of: You can not make COM objects in .NET.
> You
>> can create a wrapper class (COM Callable Wrapper) that wraps the
>> actual
> .NET
>> component up and provides COM based interfaces to the .NET object, but
>> the
>> object still runs within the context of the CLR.
>>
>> Similarly, you can't make .NET objects from, say VB 6.0. What you can do > is
>> create another type of wrapper class (a Runtime Callable Wrapper or RCW), >> that exposes the COM object to the CLR with .NET interfaces. The COM
> object
>> still runs within the context of its own runtime (in VB 6.0's case,
>> MSVBVM60.dll).
>>
>>
>>
>>
>> "Peter Rilling" <pe***@nospam.rilling.net> wrote in message
>> news:u1**************@TK2MSFTNGP15.phx.gbl...
>> > You can also make COM objects in .NET.
>> >
>> > "Scott M." <s-***@nospam.nospam> wrote in message
>> > news:et**************@TK2MSFTNGP12.phx.gbl...
>> >> It's not really what replaces COM in .NET. .NET is a replacement for >> >> COM.
>> >> When you make a class in .NET, you have just made a .NET object.
>> >>
>> >>
>> >> "gulu man" <gu*****@gmail.com> wrote in message
>> >> news:11**********************@g43g2000cwa.googlegr oups.com...
>> >> > Hi,
>> >> > What is the substitute for COM objects in .NET?
>> >> > How can I create something similar to com in .net?
>> >> >
>> >> >
>> >> > Is it still possible?
>> >> >
>> >> >
>> >> > Thank you
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Aug 6 '05 #10

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

Similar topics

1
by: Thomas | last post by:
It looks like the String.replace doesn't work in IE6.1. Anyone else has the same problem. I am using newest service package of IE and Win2K. Thanks
12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
4
by: Hardy Wang | last post by:
Hi: I have a XML like <?xml version="1.0" ?> <object> <comments>www.site.com/page.aspx?param1=value1&param2=value2</comments> </object> Since "&" is invalid in XML, I need to replace all "&"...
9
by: Crirus | last post by:
dim pp as string pp="{X=356, Y=256}{X=356, Y=311.2285}{X=311.2285, Y=356}{X=256, Y=356}{X=200.7715, Y=356}{X=156, Y=311.2285}{X=156, Y=256}{X=156, Y=200.7715}{X=200.7715, Y=156}{X=256,...
9
by: gulu man | last post by:
Hi, What is the substitute for COM objects in .NET? How can I create something similar to com in .net? Is it still possible? Thank you
12
by: Michael | last post by:
In PHP there is a function called str_replace (http://php.net/str_replace). Basically you can freed in two strings and a "subject" string. Then it goes through the subject string searching for...
1
by: fiaolle | last post by:
Hi The first set of source code is the class for a combobox in a grid, hopefully. In the second set of code we try to use the combobox class, but the grid is empty. I don't understand how this...
3
by: John Nagle | last post by:
I have XML replies in a DOM which contain entity escapes, like "&amp;". What's the proper way to replace them with the ordinary characters? Preferably something that will work in most browsers? I...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.