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 use this small utility to quickly remember what is the proper order of indexes, which exactly index I can resize through SafeArrayRedim and how exactly the values are stored in memory.


This is the the utility’s output:

Image001.png
Download:
Variant Multidimensional Arrays – Source.zip (Visual C++.NET 2002 Project)

Variant Multidimensional Arrays – Binary.zip

Leave a Reply