CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2002
    Location
    hamburg, germany
    Posts
    73

    What is the ATL?

    Can somebody tell me what the ATL is? Has it something to do with the STL(Standard Template Library)?

    Klaus


  2. #2
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: What is the ATL?

    In short terms ATL is the Active Template Library, a set of template-based C++ classes with which you can easily create small, fast Component Object Model (COM) objects... The classes in the Active Template Library can be broadly divided into three categories: classes that implement COM functionality, classes that act as thin wrappers to the Win32 API and utility classes.

    Ciao, Andreas

    "Software is like sex, it's better when it's free." - Linus Torvalds

  3. #3
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    Re: What is the ATL?

    The similarity between ATL and STL is that both of them are libraries of templates. Both of them therefore expose all their implementation code, which can be useful for debugging sometimes but generally you don't need to read into it.

    ATL is Microsoft-specific, and like Andreas said, has multiple uses, but was originally written for use with COM (Component Object Module), due to the similarity of handling COM objects of different types.

    For example, COM objects all use reference counting, and require AddRef() to add a reference and Release() to remove a reference. With ATL, you have a template class CComPtr< > which does that for you, and acts as a smart pointer, overloading the operator -> and also containing a cast to the pointer itself so that you can pass them as a parameter to functions that require a pointer to the interface.

    Another template in ATL is the similar CComQIPtr, which is used for safe type-casting using COM's QueryInterface method. This is because COM uses interfaces (abstract base classes with no data members and no private functions), and all interfaces are derived from IUnknown, one of whose methods is QueryInterface. The server deals with components, which are classes that implement the interfaces, and they can implement more than one (multiple inheritance), but the client only deals with single interfaces.

    ATL also provides wrapper classes for COM types BSTR (CComBSTR) and VARIANT (CComVariant). There are also _bstr_t and _variant_t wrappers for those types.

    Finally, there is also a WTL, which is closely related, and is called the Windows Template Library, which wraps Win32 SDK windows functionality in classes using templates, so you can do GUI programming in C++ without using MFC.


    The best things come to those who rate

  4. #4
    Join Date
    Jan 2002
    Location
    hamburg, germany
    Posts
    73

    Re: What is the ATL?

    Thanks for anwering. But what the hell is COM or a COM-Module. What is it used for. And when do you use such Modules? Is this basic-stuff or experts programmers knowlege?
    Klaus



  5. #5
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    Re: What is the ATL?

    It is used on the windows platform only, and is used for writing "components" that perform specified functionality.

    It started out as OLE - object linking and embedding - so that you could put a bitmap or an Excel spreadsheet into a Word document. Then the concept grew (as these things do) when people realised the concept was generally a good one.

    If you are going to write components using it, you should consider reading Beginning ATL 3 COM by Richard Grimes, published by Wrox. There is another one, something like COM for beginners, published by the Microsoft Corporation.

    In both the words beginning/beginner refers to COM, not to programming, and assumes you are a reasonably competent C++ programmer.






    The best things come to those who rate

  6. #6
    Join Date
    Jan 2002
    Location
    hamburg, germany
    Posts
    73

    Re: What is the ATL?

    Thanks a lot.


  7. #7
    Join Date
    Apr 2000
    Location
    Frederick, Maryland
    Posts
    507

    Re: What is the ATL?

    Currently i m writing a series of tutorial to discuss inner of ATL. Till now i have wrote two artical and currently writing part 3 of it.

    ATL Under the Hood Part 1
    http://www.codeguru.com/atl/ATL_UnderTheHood_1.html

    ATL Under the Hood Part 2
    http://www.codeguru.com/atl/ATL_UndertheHood_2.html

    Hope you ll get Part 3 soon and get some information about ATL from these tutorials.

    Hope it helps.





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