Tag: visual studio

Embedding a Git reference at build time

A while ago I posted a tool that updates a [freshly built] binary version information resource and increments build numbers for version identification and tracking. This time it is a variant of the tool: the utility would check git details for a given repository clone and embed it as a string item of the version…

Read the full article

C++ #import and x64 builds

I already wrote earlier on 32/64-bit issues with Visual Studio. The problems are not frequent but when they happen they are pretty confusing. Here is another one today. C++ code is simple: #import “libid:59941706-0000-1111-2222-7EE5C88402D2” raw_interfaces_only no_namespace CComPtr<IObject> pObject; ATLENSURE_SUCCEEDED(pObject.CoCreateInstance(__uuidof(Object))); BYTE* pnData; ATLENSURE_SUCCEEDED(pObject->Method((ULONG_PTR) (BYTE*) pnData)); A COM method returns a pointer to data – pretty straightforward,…

Read the full article


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