Category: ATL

Active Template Library related

C/C++ memory manager magic values

The values the debug version of CRT memory manager fills memory with. dbgheap.c: static unsigned char _bNoMansLandFill = 0xFD;   /* fill no-man’s land with this */ static unsigned char _bDeadLandFill   = 0xDD;   /* fill free objects with this */ static unsigned char _bCleanLandFill  = 0xCD;   /* fill new objects with this */ static unsigned char…

Read the full article

ATL: Export from registry code snippet

The code snippet exports registry key (with values and subkeys) into .reg file format stream. The stream can be memory stream or any other IStream compatible implemetnation. See also: How To Add, Modify, or Delete Registry Subkeys and Values by Using a Registration Entries (.reg) File Visual C++.NET 2003 project: Download

Multidimensional VARIANT arrays

VARIANT arrays (SAFEARRAYs) are useful because they are OLE Automation compatible but multidimensional ones are used rather rarely. Unfortunately, the order of indexes is different depending on API. Somewhere it’s normal, somewhere it’s reverse and, as for me, I need to refresh this knowledge almost every time I come across a multidimensional VARIANT array. I…

Read the full article

ATL sorting templates

Active Template Library (ATL) contains a lot of useful classes but not for sorting. There are collections classes, including CAtlArray but it does not have sorting capabilities. I would like to share quite simple C++ templates that sort.

ATL Internals

It’s quite surprising to find quite useful classes deep inside ATL core. Today I stumbled upon CStackDumper class, which looks interesting. Basically it does nothing amazing and in fact duplicates my proprietary code I use for debugging but it’s surprising to see it there. Undocumented and even Google knows little about it.