{"id":77,"date":"2006-05-06T23:16:24","date_gmt":"2006-05-06T21:16:24","guid":{"rendered":"https:\/\/alax.info\/blog\/77"},"modified":"2006-05-06T23:16:24","modified_gmt":"2006-05-06T21:16:24","slug":"multidimensional-variant-arrays","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/77","title":{"rendered":"Multidimensional VARIANT arrays"},"content":{"rendered":"<p><a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/automat\/html\/e305240e-9e11-4006-98cc-26f4932d2118.asp\">VARIANT<\/a> arrays (<a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/automat\/html\/9ec8025b-4763-4526-ab45-390c5d8b3b1e.asp\">SAFEARRAY<\/a>s) 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&#8217;s normal, somewhere it&#8217;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 <span id=\"nsrTitle\"><a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/automat\/html\/1c7fa627-e5e4-4bb9-8237-2f7358ebc4b8.asp\">SafeArrayRedim<\/a> and how exactly the values are stored in memory.<\/span><\/p>\n<p><!--more--><br \/>\nThis is the the utility&#8217;s output:<\/p>\n<p><img decoding=\"async\" alt=\"Image001.png\" id=\"image76\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2006\/05\/Image001.png\" \/><br \/>\nDownload:<br \/>\n<a id=\"p75\" href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2006\/05\/Variant%20Multidimensional%20Arrays%20-%20Source.zip\">Variant Multidimensional Arrays &#8211; Source.zip<\/a> (Visual C++.NET 2002 Project)<\/p>\n<p><a id=\"p74\" href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2006\/05\/Variant%20Multidimensional%20Arrays%20-%20Binary.zip\">Variant Multidimensional Arrays &#8211; Binary.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;s normal, somewhere it&#8217;s reverse and, as for me, I need to refresh this knowledge almost every time I come across a multidimensional VARIANT array. I&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/77\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,13],"tags":[],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-atl","category-source"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=77"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/77\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}