I need to call a COM function in C++ that returns a reference to a SAFEARRAY(BSTR)
.
According to this document, it should be:
QAxObject object = new QAxObject(...);
QStringList list;
for(int i=0; i<goodSize; i++)
list << "10.0";
object->dynamicCall("Frequencies(QStringList&)", list);
for(int i=0; i<list.size(); i++)
qDebug() << list.at(i);
but the list elements remain to 10.0
.
Am I missing something?
EDIT
I used Oleview.exe and actually, the function looks like this: void Frequencies(VARIANT* FrequencyArray);
.
But the documentation of the ActiveX server says: Use a safearray of strings (VT_BSTR) or reals (VT_R8 for double or VT_R4 for float)
.
Found the problem. It was the way to read the results. I had to read the first element of
parameters
then convert it to aQStringList
. I am angry against me :(