class SimpleVariant
{
public:
SimpleVariant() { /*...*/ };
// ...
};
struct VariantBlock
{
int nRows, nCols;
vector<SimpleVariant> theData;
};
void dumbFunction( VariantBlock& theBlock, int nRows, int nCols )
{
// ...
cout << "theBlock.nRows= " << theBlock.nRows
<< ", theBlock.nCols= " << theBlock.nCols
<< ", theBlock.theData.size() " << theBlock.theData.size();
theBlock.theData.resize( nRows * nCols );
// throws Access Violation Exception
// ...
}
Output returns that nRows=61, nCols=5, size()=0, which is exactly what it should be at that point, before an Access Violation Exception is thrown.
I'm using MSVC6, which is obviously not optimal, but there's no choice at this point.