locked
What is ATL RRS feed

  • Question

  • What is ATL ?
    why and when should I learn it?
    Where it is used and why it is used ?
    Tuesday, May 15, 2012 7:35 PM

Answers

  • It is a C++ library, with special support for interfacing using COM.  If you need to build a COM component or addin with C++ use ATL.

    • Marked as answer by Helen Zhao Wednesday, May 23, 2012 3:40 AM
    Tuesday, May 15, 2012 7:43 PM
  • Back in the good ole primitive days of programming in C (and C++), it was desirable to create a library of routines that could be re-used by other programmers (say, a statistics library). However, if the library was written in C, it was really only useable by C programmers, and not VB programmers. For the VB programmers, a completely separate library had to be designed and built in VB.

    This is what really motivated the COM standard. COM defines an binary standard so that one could build a library with a COM interface. One didn't care what language was used for the library, since the library could be called from any (COM-aware) language.

    To actually create a library that was a COM DLL using the C language is actually very tedious. There is a lot of boilerplate code that is used over and over again, and if one gets it wrong, it can be quite troublesome to debug. Frameworks emerged to help programmers create COM servers more reliably. MFC was one of the earliest frameworks to support COM. ATL came out later, and is regarded as a much cleaner framework, leveraging C++ templates that were newly supported by the framework at the time.

    Although over recent years, COM has been overshadowed by the .NET Framework development which addresses the same issue (C# can call VB.NET code, for example) the specification is receiving some attention again with the Windows 8 OS. The new WinRT (Windows Run Time) interface is essentially a refinement of the COM specification. So COM continues to live on.

    I'm not sure if it is worth it to you to learn ATL just for the sake of learning ATL. I think a better use of your time would be to learn WinRT.


    • Edited by Brian Muth Wednesday, May 16, 2012 3:36 AM
    • Marked as answer by Helen Zhao Wednesday, May 23, 2012 3:40 AM
    Tuesday, May 15, 2012 8:05 PM
  • On 15/05/2012 21:35, Freiza wrote:

    What is ATL ?

    http://en.wikipedia.org/wiki/Active_Template_Library

    http://msdn.microsoft.com/en-us/library/3ax346b7(v=vs.100).aspx

    why and when should I learn it?

    If you want to do COM programming in C++, I think ATL is the best tool for the job.
    This includes developing shell extensions in C++.
     > Where it is used and why it is used ?

    It is used extensively to do COM programming in C++ (from developing COM components, to consuming them, to developing shell extensions, etc.)

    It is designed with power and efficiency in mind; sometimes the design may seem a bit complicated, but it is for the value of efficiency.

    Giovanni

    • Marked as answer by Helen Zhao Wednesday, May 23, 2012 3:40 AM
    Tuesday, May 15, 2012 9:53 PM

All replies

  • It is a C++ library, with special support for interfacing using COM.  If you need to build a COM component or addin with C++ use ATL.

    • Marked as answer by Helen Zhao Wednesday, May 23, 2012 3:40 AM
    Tuesday, May 15, 2012 7:43 PM
  • Back in the good ole primitive days of programming in C (and C++), it was desirable to create a library of routines that could be re-used by other programmers (say, a statistics library). However, if the library was written in C, it was really only useable by C programmers, and not VB programmers. For the VB programmers, a completely separate library had to be designed and built in VB.

    This is what really motivated the COM standard. COM defines an binary standard so that one could build a library with a COM interface. One didn't care what language was used for the library, since the library could be called from any (COM-aware) language.

    To actually create a library that was a COM DLL using the C language is actually very tedious. There is a lot of boilerplate code that is used over and over again, and if one gets it wrong, it can be quite troublesome to debug. Frameworks emerged to help programmers create COM servers more reliably. MFC was one of the earliest frameworks to support COM. ATL came out later, and is regarded as a much cleaner framework, leveraging C++ templates that were newly supported by the framework at the time.

    Although over recent years, COM has been overshadowed by the .NET Framework development which addresses the same issue (C# can call VB.NET code, for example) the specification is receiving some attention again with the Windows 8 OS. The new WinRT (Windows Run Time) interface is essentially a refinement of the COM specification. So COM continues to live on.

    I'm not sure if it is worth it to you to learn ATL just for the sake of learning ATL. I think a better use of your time would be to learn WinRT.


    • Edited by Brian Muth Wednesday, May 16, 2012 3:36 AM
    • Marked as answer by Helen Zhao Wednesday, May 23, 2012 3:40 AM
    Tuesday, May 15, 2012 8:05 PM
  • On 15/05/2012 21:35, Freiza wrote:

    What is ATL ?

    http://en.wikipedia.org/wiki/Active_Template_Library

    http://msdn.microsoft.com/en-us/library/3ax346b7(v=vs.100).aspx

    why and when should I learn it?

    If you want to do COM programming in C++, I think ATL is the best tool for the job.
    This includes developing shell extensions in C++.
     > Where it is used and why it is used ?

    It is used extensively to do COM programming in C++ (from developing COM components, to consuming them, to developing shell extensions, etc.)

    It is designed with power and efficiency in mind; sometimes the design may seem a bit complicated, but it is for the value of efficiency.

    Giovanni

    • Marked as answer by Helen Zhao Wednesday, May 23, 2012 3:40 AM
    Tuesday, May 15, 2012 9:53 PM
  • On 15/05/2012 22:05, Brian Muth [MVP] wrote:


    I'm not sure if it is worth it to you to learn ATL just for the sake of learning ATL. I think a better use of your time would be to learn WinRT.

    WinRT is a Windows-8-only Metro-only technology.

    For Windows desktop development, like shell extensions development, ATL is very convenient and worth learning, IMO.
    In this regard, there's a very interesting series on CodeProject:

    http://www.codeproject.com/Articles/441/The-Complete-Idiot-s-Guide-to-Writing-Shell-Extens

    However, ATL learning curve is not trivial, so I agree that learning ATL just for the sake of it may not be a good decision.

    Giovanni

    • Proposed as answer by Helen Zhao Wednesday, May 23, 2012 3:40 AM
    Tuesday, May 15, 2012 9:58 PM
  • if you can find the old books - ATL Internals (Chris Sells) and Richard Grimes ATL books then that's all you really need.
    Saturday, May 19, 2012 3:23 AM