c++ - Qt ActiveX data types -


i developing c++/qt application communicates activex server. try use function returns reference array of floats parameter. function prototype is:

frequencies([in, out] safearray(float)*) 

my code is:

qlist<qvariant> variantlist; object->dynamiccall("frequencies(qlist<qvariant>&)", variantlist); 

but unfortunately have following error: type mismatch in parameter. pass array of type string or real.

after reading this document tried qlist<qstring>& , qlist<float>& no success.

the documentation of activex server says: use safearray of strings (vt_bstr) or reals (vt_r8 double or vt_r4 float).

any idea?

thanks!

http://qt-project.org/doc/qt-4.8/activeqt.html

the activeqt modules part of qt commercial edition , open source versions of qt.

http://qt-project.org/doc/qt-4.8/qaxobject.html#details

http://qt-project.org/doc/qt-4.8/qaxbase.html#details

here quote documentation qaxbase:

to call methods of com interface described following idl

dispinterface icontrol { properties:     [id(1)] bstr text;     [id(2)] ifontdisp *font;  methods:     [id(6)] void showcolumn([in] int i);     [id(3)] bool addcolumn([in] bstr t);     [id(4)] int filllist([in, out] safearray(variant) *list);     [id(5)] idispatch *item([in] int i); }; 

use qaxbase api this:

qaxobject object("<clsid>");  qstring text = object.property("text").tostring(); object.setproperty("font", qfont("times new roman", 12));  connect(this, signal(clicked(int)), &object, slot(showcolumn(int))); bool ok = object.dynamiccall("addcolumn(const qstring&)", "column 1").tobool();  qlist<qvariant> varlist; qlist<qvariant> parameters; parameters << qvariant(varlist); int n = object.dynamiccall("filllist(qlist<qvariant>&)", parameters).toint();  qaxobject *item = object.querysubitem("item(int)", 5); 

note qlist object should fill has provided element in parameter list of qvariants.

so need make sure nesting qlist, in order make safearray work.

hope helps.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -