What is COM?

This is a discussion on What is COM? within the C++ Programming forums, part of the General Programming Boards category; i start this tutorial at codeproject.com about writing shell extensions, and it says i have to know about COM stuff. ...

  1. #1
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401

    What is COM?

    i start this tutorial at codeproject.com about writing shell extensions, and it says i have to know about COM stuff. what the hell is COM, and how can i learn it?
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    At its most basic, COM is a method of programming classes with interfaces.....Instead of exporting a concrete class, you export a purely abstract class which acts as an interface.......with your main class you inherit from this interface...

    Also, your exported interface inherits from IUnknown (the base COM interfaces that all COM interfaces inherit from)...this interface supports 3 abstract functions;

    QueryInterface - to get other interfaces
    AddRef - To increase usage count of a COM object
    Release - To decrease usage count of a COM object

    There are lots more things you need to learn before implementing a COM compeonent in C++ (ClassObjects, registration, apartments)....Best bet is to do some reading......Inside COM is a good book so I hear......I have Inside ATL (also by M$Press, but specific to ATL which is a tool like MFC to allow you to create COM classes quickly)...

  3. #3
    Frank_1974_@@
    Guest

    Red face

    I this it's better that you buy a book .
    I suggest inside ATL . I also suggest to avoid using
    MFC for bulding com Objects.
    In a few words ,COM is an architecture for libraries.
    It has been developed at microsoft .
    The idea was to export a few standard functions from a dll ,
    all this to get a pointer to a structure contained inside the library.
    It's a little more complex because remote calls to funtions can be mande inside the class . It's interesting also because there is
    a standard interface on wich you can "plug" what they call
    containers like an IDE or whatever.
    Buy a book or find stuff on the net.

  4. #4
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    This belongs on the system interface board. You are searching for Microsoft specific information. Try the Microsoft website < www.msdn.microsoft.com/library >.

    On this board you write your own abstract classes, both the interfaces and the implementation.

    You don't write shell extensions on the Microsoft operating system. It is illegal.

  5. #5
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    Originally posted by Frank_1974_@@
    I this it's better that you buy a book .
    I suggest inside ATL . I also suggest to avoid using
    MFC for bulding com Objects.
    I second both of these statements, great book. ATL has a nice enough wizard for MFC people and MFC is kind of a lousy way to distribute a control.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21