Tag: ATL

Range-based for with ATL Collections

ATL collection classes did not receive an update related to new C++11 range-based fors and other fancy features. Well it’s a pity because writing for(auto&& pPin: AudioPinList) pPin-> //… compared to for(POSITION Position = AudioPinList.GetHeadPosition(); Position; AudioPinList.GetNext(Position)) { IPin* pPin = AudioPinList.GetAt(Position); pPin-> //… is indeed a relief. Namespace std is, of course, good but…

Read the full article

ATLENSURE_SUCCEEDED double failure

A colleague pointed out that code snippet in previous post is misusing ATL’s ATLENSURE_SUCCEEDED macro making it [possibly] evaluate its argument twice in case of failure, that is evaluating into failure HRESULT code. As it is defined like this: #define ATLENSURE_SUCCEEDED(hr) ATLENSURE_THROW(SUCCEEDED(hr), hr) It does things in a straightforward way, for a code line ATLENSURE_SUCCEEDED(pFilterGraph.CoCreateInstance(CLSID_FilterGraph));…

Read the full article