Questions tagged [atl]

The Active Template Library (ATL) is a library of C++ class templates provided by Microsoft that simplify the programming of Component Object Model (COM) objects. This tag should be used to indicate questions about the use of ATL. For questions about COM unrelated to ATL use the com tag.

The Active Template Library (ATL) is a set of C++ class templates that simplify the programming of Component Object Model (COM) objects. When first introduced around the time of Visual C++ 5.0 and Windows 95 the name of the library was ActiveX Template Library as it was intended to be used for the development of ActiveX objects.

The library can be used for purposes other than COM programming as it provides templates for a number of pieces of functionality including thread and window management. ATL can be used as a lightweight alternative to MFC to program Win32 GUI desktop applications and is the basis for the Windows Template Library (WTL).

ATL provides several different classes for programming both client and server COM objects. It has been extended over the years with additional functionality to support more complex COM objects.

The library uses an RAII approach along with smart pointers and automatic reference counting to wrap much of the underlying Windows API used for COM objects to make programming COM easier and safer.

The library is available with retail versions of Microsoft Visual Studio, see details and reference on MSDN: ATL Reference.

1334 questions
208
votes
11 answers

How to get started with developing Internet Explorer extensions?

Does anyone here have experience with/in developing IE extensions that can share their knowledge? This would include code samples, or links to good ones, or documentation on the process, or anything. I really want to do this, but I'm hitting a giant…
Alex
  • 64,178
  • 48
  • 151
  • 180
119
votes
3 answers

What's the fundamental difference between MFC and ATL?

Assuming I am only using them for "normal" GUI programs (no COM, no ActiveX, nothing fancy), what is the fundamental difference I will see between ATL and MFC, to help me figure out which one to use? I've done some searches on the web, but…
user541686
  • 205,094
  • 128
  • 528
  • 886
77
votes
6 answers

How do I decide whether to use ATL, MFC, Win32 or CLR for a new C++ project?

I'm just starting my first C++ project. I'm using Visual Studio 2008. It's a single-form Windows application that accesses a couple of databases and initiates a WebSphere MQ transaction. I basically understand the differences among ATL, MFC, Win32…
John M Gant
  • 18,970
  • 18
  • 64
  • 82
30
votes
3 answers

What is the ($Foo)PS project in my $Foo ATL solution for?

Creating an ATL project in MSVC seems to create not one but two projects; the latter named the same as the former but with PS appended to its name. What is the purpose of this second project and how can I tell whether I need it?
Sideshow Bob
  • 4,566
  • 5
  • 42
  • 79
25
votes
5 answers

How to add WTL and ATL to visual studio c++ express 2008

I start using the visual studio c++ express 2008 at home but there is no ATL in it. How can I add ATL to visual studio c++ express 2008?
Oren F
25
votes
2 answers

Right single apostrophe vs. apostrophe?

Right single quotation mark (U+2019) vs. Apostrophe (U+0027) What is the difference between these two characters? I ran into this issue where I use CAtlString to load a string from a resource file, and on some Windows installations,…
TripShock
  • 4,081
  • 5
  • 30
  • 39
24
votes
4 answers

Warning C4251 when building a DLL that exports a class containing an ATL::CString member

I am converting an ATL-based static library to a DLL and am getting the following warning on any exported classes that use the ATL CString class (found in atlstr.h): warning C4251: 'Foo::str_' : class 'ATL::CStringT' needs to have dll-interface…
Rob
  • 76,700
  • 56
  • 158
  • 197
23
votes
5 answers

Getting "Cannot open include file: 'atlbase.h': No such file or directory" error

I am swapping machines (between two Windows 8.1 laptops) and have just loaded the project I'm working on from TFS. On one machine it compiles, on the other it does not and gives the first error error C1083: Cannot open include file: 'atlbase.h': No…
dumbledad
  • 16,305
  • 23
  • 120
  • 273
21
votes
5 answers

What is the use of CComPtr over CComQIPtr in COM?

Can any one explain, What is the use of CComPtr over CComQIPtr in COM? CComPtr Sample1; CComQIPtr Sample2;
Ramesh
  • 257
  • 1
  • 3
  • 5
20
votes
4 answers

CComVariant vs. _variant_t, CComBSTR vs. _bstr_t

I am using ATL (VS2008, so ATL9 IIRC) to create COM objects and have been using the CComVariant class (defined in atlcomcli.h) to manage VARIANT types. However, there is also another VARIANT wrapper called _variant_t. Is there any difference…
Rob
  • 76,700
  • 56
  • 158
  • 197
18
votes
1 answer

How to write a shell extension in C++?

This seemed like a common question but after doing some searching, I wasn't really able to find my answers. There is an article on this here: http://www.codeproject.com/KB/shell/shellextguide1.aspx But it's for a very old version of Visual Studio.…
void.pointer
  • 24,859
  • 31
  • 132
  • 243
16
votes
1 answer

Hosting Silverlight in C++

I'm a bit over my head here and would like some advice on how to go about. Basicly what I want to do is to be able to render and control silverlight inside my C++ application. I would like something as: class silverlight_host { public: //…
ronag
  • 49,529
  • 25
  • 126
  • 221
15
votes
1 answer

Out-of-proc COM server stuck

I'm using out-of-proc COM server (COM singleton "Engine" implemented using DECLARE_CLASSFACTORY_SINGLETON), it works in STA (CComSingleThreadModel, _ATL_APARTMENT_THREADED). COM server clients: ActiveScript (JScript), (I pass Engine reference using…
KAdot
  • 1,997
  • 13
  • 21
13
votes
2 answers

Random crashes on Windows 10 64bit with ATL subclassing

Just from the start: Since March 1st 2017 this is a bug confirmed by Microsoft. Read comments at the end. Short description: I have random crashes in larger application using MFC, ATL. In all such cases after ATL subclassing was used for a window…
xMRi
  • 14,982
  • 3
  • 26
  • 59
13
votes
4 answers

atlbase.h not found when using Visual C++ Express 2010

So I tried moving my project to Visual C++ Express 2010 on Windows 7 from a previous version on Windows XP. I got all sorts of errors where atlbase.h was not found. This isn't so much a question but I wanted to document what my resolution was for…
user322024
  • 141
  • 1
  • 1
  • 3
1
2 3
88 89