Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


Harris Geospatial / Docs Center / Using IDL / Why Storage and Access Matter

IDL

Why Storage and Access Matter

Why Storage and Access Matter

Clients that need to pass an array to IDL need to understand the memory layouts of the arrays in order to know if they should convert arrays from one format to the other. Simply trying to understand which format is “row” and which is “column” major is not enough because the definitions of those terms can differ in context.

Understanding these distinctions are critical when programming in Visual Basic and C++ as each language natively stores arrays differently. However, using the Win32 Safearray APIs, either directly or indirectly through the ATL wrapper classes, allows C++ code to create safe arrays in the same order as Visual Basic. However, C++ has the flexibility to create safe arrays ordered differently, which is useful for testing.

In summary:

  • SAFEARRAYs and IDL arrays are stored differently and must be converted to be used by each other
  • Multidimensional SAFEARRAYs are stored as “column major” in linear memory (i.e., a column is stored contiguously in memory)
  • IDL stores multidimensional arrays as “scanline major” (i.e., stores each scanline contiguously in memory)
  • All the Win32 APIs and ATL safe array wrapper classes access SAFEARRAYs in column major
  • Visual Basic accesses SAFEARRAYS as “column major”
  • Native C++ arrays are stored and accessed as “row major”



© 2017 Exelis Visual Information Solutions, Inc. |  Legal
My Account    |    Buy    |    Contact Us