Results 1 to 5 of 5

Thread: How to code for COM, COM+ & DCOM components ??

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    81

    Question 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

  2. #2
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963

    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
    ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
    Programming is fun, but only if you're not on a tight deadline
    So I consider all those working engineers sad people

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    81

    Question 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
    Manoj
    Last edited by Manoj91; Oct 19th, 2006 at 01:25 AM.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    81

    Re: How to code for COM, COM+ & DCOM components ??

    Hi All,

    Anyone please respond to this post,,,,,,,,,,,,,,,

    Thanks & Regards
    Manoj

  5. #5
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963

    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.
    ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
    Programming is fun, but only if you're not on a tight deadline
    So I consider all those working engineers sad people

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width