Главная страница | назад





Article #26296: Why am I getting access violations using SafeArrays of more than one dimension?

Question

Why is my SafeArray giving me access violations?

Answer

TSafeArrayT does not currently support multi-dimensional arrays. This problem is easily fixed by modifying the class's destructor in the safearry.h file.

change:to:

~TSAAccessorT()
{
if (m_Alloc)
delete[] m_Indices;
}

~TSAAccessorT()
{
if (m_Alloc) {
m_Indices--;
delete[] m_Indices;
}
}

Last Modified: 16-NOV-00