Error Calling Idispatch Member Unknown Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions
Qt Activex Example
you might have Meta Discuss the workings and policies of this qaxobject excel example site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers
Qaxobject Example
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a qaxcontainer community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Share QAxObject between two threads? up vote 0 down vote favorite Let's say an object A running in a thread. It has a pointer to a QAxObject instance and to an object B. The activeqt object B has the pointer to the QAxObject. Object A creates a thread and moves the object B in it. #ifndef OBJECTA_H #define OBJECTA_H #include
download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript). Home Qt Development General and Desktop Qt and COM problem (QvariantList &*) Qt and COM problem (QvariantList &*) This topic has been deleted. Only users with topic management privileges can see it. RavensAngel last edited by All, i'm trying to access a COM object using Qt. I used dumpcpp to http://stackoverflow.com/questions/15924998/share-qaxobject-between-two-threads generate the c++ namespace for the type library. While i can use some methods without problem, i have troubles using the following method, documented as followed: void SetBillTypeEnables (QVariantList*& billTypeEnables) [slot] Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal(QVariantList*&)), object, SLOT(SetBillTypeEnables(QVariantList*&)));Or call the function directly: @QVariantList params = ... object->dynamicCall("SetBillTypeEnables(QVariantList*&)", https://forum.qt.io/topic/17675/qt-and-com-problem-qvariantlist params);@ I tried couple of things, but it doesn't seem to work. The method actually requires a reference to an array of booleans (5). Dumpcpp converted it into the QVariantList*& parameter. Any help on how to call this. I tried the following, which in my opinion should work, but it doesn't: @VariantList* newValues = new QVariantList( ); newValues->append( false ); newValues->append( true ); newValues->append( true ); newValues->append( true ); newValues->append( true ); _acc->dynamicCall( "SetBillValueEnables( QVariantList & )", qVariantFromValue( (void) newValues ) );@ The qVariantFromValues is required, because QVariant doesn't accept a pointer as argument at construction. The actual result = the debugger showing me the follwing error: QAxBase: Error calling IDispatch member SetBillValueEnables: Unknown error The error message is rather obscure and i don't have to much experience with COM. But has anyone a clue on how i can solve this, or what i do wrong? Thx in advance. Edit:
I don't know how to deal with VARIANT. In VC++ 6; void DoGo(short nNumberOfAxes, const VARIANT& nAxisArray); example code: const int nSize(3); http://www.qtcentre.org/archive/index.php/t-24201.html short nAxesArray[nSize] = { 0, 1, 2}; COleSafeArray arrAxes; arrAxes.CreateOneDim(VT_I2,nSize,nAxesArray); MintController1.DoGo (3, arrAxes); In Qt, What I get is: void DoGo (int nNumberOfAxes, QVariant nAxisArray) [slot] call the function directly: QVariantList params = ... object->dynamicCall("DoGo(int, QVariant)", params); So, anyone can give me an example code. I don't know how to write params Please help. Thanks. kwisp22nd September 2009, 06:27try QString QAxBase::generateDocumentation error calling () and find analog COleSafeArray in Qt may be QVector ? dbzhang80022nd September 2009, 11:35Documentation string generated by QString QAxBase::generateDocumentation () : void DoGo (int nNumberOfAxes, QVariant nAxisArray) [slot] For more information, see help context 0 in C:\Program Files\WorkBench v5\MintControls.hlp. Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal(int, QVariant)), object, SLOT(DoGo(int, QVariant))); Or call the function directly: QVariantList params = error calling idispatch ... object->dynamicCall("DoGo(int, QVariant)", params); function generated through dumpcpp -getdoc is: inline void _DMintControllerCtrl::DoGo(int nNumberOfAxes, const QVariant& nAxisArray) { void *_a[] = {0, (void*)&nNumberOfAxes, (void*)&nAxisArray}; qt_metacall(QMetaObject::InvokeMetaMethod, 176, _a); } I try to use QVector, but I don't know how to cast QVector to QVariant Any suggestion? kwisp22nd September 2009, 13:16may be QVariant ( const QList