PDA

View Full Version : Excel range will crash once i get the values



ZHawk
16th December 2010, 11: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

ZHawk
3rd January 2011, 09:13
i finally found out myself
i am using Visual Studio 2010 Express
changing the "platform toolsets" from "v100" to "v90" has fixed my heap corruptions

timohare
12th July 2011, 07:22
Looks like a Qt/MSVC 2010 compiler bug
http://bugreports.qt.nokia.com/browse/QTBUG-18904
http://bugreports.qt.nokia.com/browse/QTBUG-11445