Where can I get the Active Template Library?
Asked Answered
Z

6

9

I've never worked with COM before, and I've been tasked with writing an application that uses some third party COM objects. If anyone could point me to some good tutorials on how to use them it would be much appreciated. More immediately, it appears that I don't have the Active Template Library installed. I've searched online but can't figure out how to get it.

Zosima answered 17/4, 2009 at 21:0 Comment(1)
In November 2014, Microsoft released a free »Community Edition« of Visual Studio 2013 Update 4, which included both ATL and MFC. As of January 2016, they're still part of Visual Studio 2015 Community Edition.Myna
C
4

As Dan pointed out, these are distributed with Visual Studio.

If you don't have Visual Studio, you can get the ATL libraries from one of the Microsoft Visual C++ Redistributable packages:

Note: The ones marked 2005 are version 8 (atl80.dll), the ones marked 2008 are version 9 (atl90.dll).

Corry answered 17/4, 2009 at 21:9 Comment(4)
That's not going to get you the headers so that you can actually write ATL code, right?Chimere
I've never done work with ATL. I just assumed it was done via DLL calls.Corry
I dont see atl components when I click add item in my atl project. There is no Visual C++/ATL categoryRader
Those links are broken. Now they just take me to a page to download Windows, Office, etc.Eberly
H
4

It's part of Microsoft Visual Studio (but not the Express Edition.)

Hensley answered 17/4, 2009 at 21:5 Comment(0)
C
4

As Dan pointed out, these are distributed with Visual Studio.

If you don't have Visual Studio, you can get the ATL libraries from one of the Microsoft Visual C++ Redistributable packages:

Note: The ones marked 2005 are version 8 (atl80.dll), the ones marked 2008 are version 9 (atl90.dll).

Corry answered 17/4, 2009 at 21:9 Comment(4)
That's not going to get you the headers so that you can actually write ATL code, right?Chimere
I've never done work with ATL. I just assumed it was done via DLL calls.Corry
I dont see atl components when I click add item in my atl project. There is no Visual C++/ATL categoryRader
Those links are broken. Now they just take me to a page to download Windows, Office, etc.Eberly
C
3

I think you have to own a copy of Visual Studio 2005 or 2008 (not Express) to get ATL. If you have one of those installed, but you don't have ATL then go to "Control Panel:Add/Remove Programs" and do a "Modify" install (with the program CD or DVD in the drive) and make sure the box for ATL is checked.

Chimere answered 17/4, 2009 at 21:7 Comment(0)
V
3

As for tutorials:

I haven't found a really good one online. There are a few OK pages on using ATL/COM:

  • The Active Template Library Makes Building Compact COM Objects a Joy by Don Box (veteran guru of COM). This article starts: "I love COM. COM is good. Like a fine pilsner or ale, COM never disappoints. In fact, the more I look at COM, the more I like it. Unfortunately, I work in C++, and C++ does not share my appreciation for the finer things in life." Despite the Grand Master's proselytizing, and the fact that it's 12 years old now, it's a pretty good article...
  • Mike Dunn's excellent tutorial on COM on CodeProject.
  • DevGuy's C++ COM Tips -- kind of a hodgepodge of links and suggestions.
  • The COM Programmer's Cookbook -- this ancient (1995) article isn't bad, despite its age and the fact that it describes implementing COM objects in C rather than C++ (explicit vtables!)

I'm a little rusty myself w/ COM and ATL, but if I remember right, the classes you're going to want to learn that you'll use the most (especially if you are using someone else's COM objects rather than implementing your own) are CComBSTR, CComPtr, and CComVariant. Also the #import statement in Visual C++ makes using external COM objects much easier, it generates a smart pointer class for you from an external DLL or EXE.

If you're going to be implementing COM objects, I would strongly recommend getting a copy of ATL Internals (there's a newer edition out now covering ATL v8). Yes it does go into some gory detail in sections, but even as an intro book it's fairly well written.

If you've never used COM before, the "classic" books Essential COM and Effective COM are very good and you can probably get them inexpensively from your favorite sources of used books. You're also going to want to be very familiar with the RAII idiom, if you aren't already.

The newsgroup microsoft.public.vc.atl is very good for asking particular questions. (they tend to be more gruff there than on StackOverflow, though)

Beware: There are lots of little gotchas with COM, although ATL does help it become a lot easier & without a lot of bloat. The "simulated dynamic binding" techniques aka CRTP are useful in the C++ world, not just in the context of ATL/COM but especially if you are developing a library of reusable classes that you want to subclass or mixin in situations where only one instance is present at a time (e.g. a class CSpiffyFramework that provides mixin functionality that you want to reuse a lot, and you have a derived class that you want to include that functionality, and it's not part of a virtual object model so you don't really need a vtable).

Good luck!

Volunteer answered 17/4, 2009 at 22:13 Comment(0)
B
0

I installed this: http://www.microsoft.com/en-us/download/details.aspx?id=3138 and got the C++ compiler and all stuff on my buildserver, but no ATLMFC libraries. The redist packages linked above is just that, redistributables, not the headers and includefiles needed.. After lots of searching, I ended up installing vs2008 on the server, crap.

Berhley answered 12/11, 2013 at 12:39 Comment(0)
G
-1

here is how to use atl with vs express:

you need WDK 7.1.0:

https://www.microsoft.com/en-us/download/details.aspx?id=11800

  1. Download Visual Studio Express Edition

    Get VS Express C++ free from Microsoft

  2. Download the freely available Windows Driver Kit (7.1 or later) from Microsoft

    Get WDK 7.1.0 free from Microsoft

    You can mount the ISO file with Virtual Clone Drive or extract it with 7-zip.

  3. Install the WDK and select the "Build Environments" option

    This will install the ATL and MFC header and lib files. ATL is a requirement for FireBreath on windows. Make sure to install this in the default location so that FireBreath can find it

  4. For VS Express 2010

    If you are using an older version of FireBreath, this post by scjohn may be useful for you. Note that FireBreath 1.4 beta 1 and later these steps are no longer needed!

http://www.firebreath.org/display/documentation/Building+with+Visual+Studio+Express

[vs2010 express include path]

C:\WinDDK\7600.16385.1\inc\atl71

[vs2010 express lib path]

C:\WinDDK\7600.16385.1\lib\ATL\i386

Gala answered 14/12, 2017 at 8:12 Comment(3)
This is outdated and wrong overall. ATL is included in free "Community" editions of a few last releases of Visual Studio. No need to install WDK, and then WDK's ATL is a reduced version.Tarsus
@RomanR. i hope you are right, but look at this link: #3898787 and community version is not free for commercial purpose at certain condition. express version only last hope or mingw, clang etc.Gala
The linked question has an answer with screenshot with boxes to check to get ATL. Note that WDK's ATL you linked is _ATL_VER=0x0800 which corresponds to Visual Studio 2005. Not only it does not make sense for development with current toolsets, the code does not have to even compile and does not have to run safely (2005 ATL has DEP related issues in particular).Tarsus

© 2022 - 2024 — McMap. All rights reserved.