Question

I'm trying to use CComHeapPtr smart pointer with Embarcadero C++Builder 2010, but can't find the definition in any of the supplied headers. And I get this error.

[BCC32 Error] E2451 Undefined symbol 'CComHeapPtr'

It's not in atlbase.h (and atlalloc.h seems to be completely missing).

I intended to use this to give exception-safe freeing of the ItemIDList returned from IShellFolder::ParseDisplayName.

Is it present in this version, or does C++Builder just use an incredibly old version of ATL?

And, other than just rolling my own, is there a better alternative?

Was it helpful?

Solution

CComHeapPtr is not available in any version of ATL that has shipped with C++Builder.

C++Builder does support ATL, but older versions of it. Microsoft has stopped licensing ATL to third-parties, and the latest ATL relies on VC++-specific compiler extensions. C++Builder XE is the last version that ships with working ATL files. C++Builder XE2 onwards still support ATL but only if you have a copy of the ATL files from an earlier C++Builder version (XE2 has stub files that have #error statements to warn you if you try to use them). ActiveX is officially supported using Embarcadero's own DAX framework now, which is not ATL-compatible.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top