Results 1 to 15 of 15

Thread: What is it?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Location
    Atlanta
    Posts
    12

    What is it?

    What is COM. I always see it, and I'm learning VB now. I can't seem to get a straight answer on COM.
    Kung Fu is for everything, everything is Kung Fu= Time+Energy

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    From MSDN:

    Component Object Model (COM)
    The OLE object-oriented programming model that defines how
    objects interact within a single process or between processes. In
    COM, clients have access to an object through interfaces
    implemented on the object.

    COM Overview
    The Component Object Model (COM) is a binary standard that
    defines how objects are created and destroyed and, most
    importantly, how they interact with each other. As long as
    applications follow the COM standard, different applications from
    different sources can communicate with each other across
    process boundaries. People use COM to make communication
    with other applications easy.

    Because COM is a binary standard, it is language independent.
    You do not have to use C++ to implement COM. You can use any
    language that supports tables of function pointers.

    A COM interface is a collection of logically related methods that
    express a single functionality. For example, the IAsyncReader
    interface enables reading of MEDIATYPE_Stream data. All COM
    interfaces derive from IUnknown, and all are named by a globally
    unique interface identifier (IID).

    A COM class is an implementation of one or more COM interfaces,
    and a COM object is an instance of a COM class. A Microsoft®
    DirectShow™ filter, for example, is a COM object. Each object has
    a globally unique class identifier (CLSID).

    Kinda formal explanation, but just search the forums for some
    examples that may give you a better explanation.

    HTH
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Location
    Atlanta
    Posts
    12
    Thanks. Um, basicly COM helps .exe files communicate with each other. Can COM pass information from application to application? How would I develop COM functions, what is the environment and how would I find the syntax?
    Kung Fu is for everything, everything is Kung Fu= Time+Energy

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    I haven't really used COM outside of MS Office, but this is the
    same. If you add a reference to MS Access in a new vb standard
    project, you can use the Object Browser to see all the objects,
    properties, and events available from Access. You can add
    another reference to MS Excel and see its Objects the same way.
    Then you can create an instance of Access and Excel and
    automate them through VB. You would be using Components of
    Access and Components of Excel. Basically COM is Components
    that can be reused in other applications by referencing their
    object libraries. I may not have the entire concept, but this is the
    basics. I suggest searching for examples and tutorials to help you
    more.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Location
    Atlanta
    Posts
    12

    MS Office and COM

    so, COM is mainly used to communicate between MS Office applications like Word and Excel? What environment is COM developed in?
    Kung Fu is for everything, everything is Kung Fu= Time+Energy

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Not at all. COM is used in multi-tiered apps. You write a dll for one
    program, and say, you need to use some function in another app,
    then you could create an instance of the object and execute the
    function. I am probably not explaining everything correctly, but I
    am still learning COM or distributed applications.

    COM objects could be written in C++ or VB I believe.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: MS Office and COM

    Originally posted by SEGACIOUS
    so, COM is mainly used to communicate between MS Office applications like Word and Excel? What environment is COM developed in?
    COM exists as a Windows Communication Layer used as a Marshaling medium used for Inter-Application Communications.

    IE.. App1 -> Windows -> App2 -> Windows -> App1

    P.S. Com, OLE and, ActiveX can be used interchangeably. Microsoft has changed all those definitions over the years and they have all at one time meant the same thing.

    AFAIK no other OS supports COM, although some could argue SOAP is a version of COM... or was that CORBA...

  8. #8
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    This article (pushing COM development) has a good description of multi-tier (or is it multi-layer ) development (It's a good read).

    http://msdn.microsoft.com/library/de...complus4vb.asp

  9. #9
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    10 years old, but talks about OLE 2.0 which is COM:

    http://msdn.microsoft.com/library/de...msdn_ole2d.asp

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Thanks Dave for a much better explaination.

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    Other points of interest (for the truly bored) are IDL (Interface Description Language) and ATL (Active Template Library), which are the foundations which COM is built on.

  12. #12
    Lively Member
    Join Date
    Sep 2004
    Posts
    74
    The best description for com is :
    An programming indepent system for developing reusable components

    COM is an interface that can communicate with almost any programming language.

    The main advantage is that i could write an component in C++ and (if i do it by the rules) VB can use that component.

    The only prob is that C++ have way more flexiblity to bend the rules of com than VB so lot's of components work very poor with other languages.
    Even Microsoft didn't always obeys it's own rules.

  13. #13
    Lively Member
    Join Date
    Sep 2004
    Posts
    74
    Originally posted by Dave Sell
    Other points of interest (for the truly bored) are IDL (Interface Description Language) and ATL (Active Template Library), which are the foundations which COM is built on.
    ATL is an library which can be used to build COM, but COM componets can also be build using MFC

  14. #14
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    isnt ATL built on top of MFC?

  15. #15
    Lively Member
    Join Date
    Sep 2004
    Posts
    74
    Originally posted by Dave Sell
    isnt ATL built on top of MFC?
    Nope, ATL is an complete differnt,

    they can be used in an single component, but they can also be used indepently.

    Actually ATL was created to get rid of the overhead of MFC, it's used to create lightweight and fast code, as MFC is used to create slower bulkier code.

    Rule of thumb :
    MFC => Mainly GUI (clients), nowadays actually VB(.net)
    ATL => Mainly fast (COM)DLL's without an GUI interface.

    ATL+MFC => (com)DLL's with an GUI

    MFC=> (com)DLL's just as fast as VB activeX, so no need for it to do it in C++ then

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