CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2012
    Posts
    18

    Component Object Model?

    Hi
    I'm trying to put together a picture of what it is I have to do to use the Microsoft Component Object Model to automate, create, and manipulate Microsoft word and excel documents.


    1 - Despite googling this to death I'm not sure about a few things.
    To use the Component Object Model do I have to have VC++ installed. I am using a MinGW compiler in CodeBlocks IDE. Can I use and compile COM with this compiler and setup?


    2 - Is the COM a sub-part of MFC? Or is it something totally different?


    3- Do I download and install COM DLL's or are they already installed as part of the Microsoft office application and windows application installed on my PC?

    4 - Can I do everything possible with a Word file or Excel file when using the COM?
    Would anyone know of any books which explain how to use COM with Microsoft Office Applications?

    Thanks
    Last edited by tomadom; June 16th, 2015 at 05:49 AM.

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Component Object Model?

    Quote Originally Posted by tomadom View Post
    Hi
    I'm trying to put together a picture of what it is I have to do to use the Microsoft Component Object Model to automate, create, and manipulate Microsoft word and excel documents.
    So far so good.

    1 - Despite googling this to death I'm not sure about a few things.
    To use the Component Object Model do I have to have VC++ installed. I am using a MinGW compiler in CodeBlocks IDE. Can I use and compile COM with this compiler and setup?
    COM has nothing to do with VC++. COM standardizes a particular flavor of ABI. Any compiler able to produce the said binary format is going to work for you. More or less painful, which is the real question you are to bother about. For example, Visual Basic or C# or Delphi work like a charm with COM while being definitely not a VC++. And VC++ is definitely not an ideal IDE to deal with heavyweight COM stuff like Word/Excel/PowerPoint.

    2 - Is the COM a sub-part of MFC? Or is it something totally different?
    COM itself has nothing to do with MFC. Though MFC provides some level of support in programming COM. Same does ATL.

    3- Do I download and install COM DLL's or are they already installed as part of the Microsoft office application and windows application installed on my PC?
    MS Office products being installed provide COM servers. Refer to documentation for Office products automation.

    4 - Can I do everything possible with a Word file or Excel file when using the COM?
    Would anyone know of any books which explain how to use COM with Microsoft Office Applications?
    You can do everything with Word or Excel what MS makes possible with Office Automation interfaces. What part of that suits your needs, or what part you're able to handle, it's all up to you. As for the books, try searching through Amazon for Office Automation. But be prepared for near to zero information regarding how to deal with COM in IDEs other than ones from MS.
    Last edited by Igor Vartanov; June 16th, 2015 at 10:36 AM.
    Best regards,
    Igor

  3. #3
    Join Date
    Dec 2012
    Posts
    18

    Re: Component Object Model?

    Thanks for the reply. I think I'm in for allot of work to set this up. There are books on Amazon on COM so I'll try what you've suggested.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Component Object Model?

    Search for "excel automation in C++ ATL" or "word automation in C++ ATL"

    ATL has a few classes that wrap the com interfaces that are a bit easier to work with than the MFC wrappers, imo.

  5. #5
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Component Object Model?

    I believe, ATL is supplied as a part of VC++ Professional or higher. Well, AFAIR a couple of years ago ATL 3.0 and MFC 4.2 were included into Platform SDK, but those are really, really outdated.
    Best regards,
    Igor

  6. #6
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: Component Object Model?

    AFAIK, Visual Studio Community is a full featured edition (include ATL, MFC and so on) and free under some conditions.
    Last edited by ovidiucucu; June 17th, 2015 at 12:38 PM.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  7. #7
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Component Object Model?

    Well then, good news for OP.
    Best regards,
    Igor

  8. #8
    Join Date
    Dec 2012
    Posts
    18

    Re: Component Object Model?

    Thanks again everyone. Very helpful posts. This should keep me busy for a while.

Tags for this Thread

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

Featured