ZHawk
16th December 2010, 10:10
hi,
reading single cells from excel is fine but reading a range causes problems.
this code is fine:
QAxObject *range = sheet->querySubObject("Range(QString)", "A4:A5");
but calling this afterwards:
QVariant v = range->dynamicCall("Value()");
will give me a heap corruption
this will fix it but will result in memory leaks:
QVariant *v2 = new QVariant(v);
deleting v2 will again result in heap corruption
anyone knows why ?
BTW: cell values: A4 = 0 and A5 = 1
reading single cells from excel is fine but reading a range causes problems.
this code is fine:
QAxObject *range = sheet->querySubObject("Range(QString)", "A4:A5");
but calling this afterwards:
QVariant v = range->dynamicCall("Value()");
will give me a heap corruption
this will fix it but will result in memory leaks:
QVariant *v2 = new QVariant(v);
deleting v2 will again result in heap corruption
anyone knows why ?
BTW: cell values: A4 = 0 and A5 = 1