How to code for COM, COM+ & DCOM components ??
Hi All,
I studied about Component Object Model but didn't find any sample code which can help me to code mine.
I want to start COM & DCOM programming in VB. Can anybody provide some information on this.
Sample code will be an added advantage and highly appreciated.
Thanks & Regards
Manoj :)
Re: How to code for COM, COM+ & DCOM components ??
to differentiate COM, COM+ and DCOM, here's a good resource:
http://www.sei.cmu.edu/str/descriptions/com_body.html
to do COM programming, you can create an ActiveX DLL project, add a class module,
and write Public methods/Properties. Compile it.
In your client app, add reference to that DLL you made, and you can start using it by
creating it. E.g:
Dim a As Myclass
Set a = New Myclass
a.mymethod(j,k,12,5)
If you want to do DCOM, I suggest this link:
http://support.microsoft.com/?id=266717
Re: How to code for COM, COM+ & DCOM components ??
Hi,
Thanks for the valuable information. I tried this and it worked fine for me.
COM means code reuse i.e. suppose we have written a class in C++ and the same we need in Visual Basic then we need to code in VB again but COM feature allows us to create DLL file for the code written in C++ and use it in our Visual Basic Project by Referencing it. RIGHT ???
I wrote a class in C#.Net and build it I mean created a DLL file. Then tried it to reference it in my Visual Basic 6.0 project. But it is showing me an error that "Cann't reference............" I don't know what's wrong with this...........
DCOM is nothing but Distributed COM it is used to create client/server applications. I read that topic on http://support.microsoft.com/?id=266717 and tried it. It worked fine in one computer but if I try to install my server on one PC and client on another PC then the problem occurs. I think it's a network issue.
One thing I'm interested to know is in Winsock control we need to mention IP address of remote machine where our server is listening and we want our client to connect. But in DCOM example I didn't find such thing then how the client is able to connect to the server ? Can it be connected only by network address that we provide,,,,,,,,??
Please provide some more links and sample code. I'll be very much thankful for this.
Please tell me whether I've understood this COM, DCOM concept correctly or not,,,,,
Thanks & Regards
:eek2: Manoj :)
Re: How to code for COM, COM+ & DCOM components ??
Hi All,
Anyone please respond to this post,,,,,,,,,,,,,,,
Thanks & Regards
Manoj :thumb:
Re: How to code for COM, COM+ & DCOM components ??
i feel irresponsible if I don't reply.
The link I gave you actually does tell you how to set up the address on the client. It's
done during the installation phase.
I don't think you can use .NET created components with VB6.
And you're right about code reuse. COM facilitates this. Plus each version of a
particular component follows a strict interface (determined in the first version of it)
so that there won't be incompatibilities between newer components and clients.