Error Calling Idispatch Member
Contents |
download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript). Home Qt Development General and Desktop [edit] ActiveQt dynamicCall error: bad parameter count despite the right number [edit] ActiveQt dynamicCall error: bad qt activex example parameter count despite the right number This topic has been deleted. Only users with qaxobject excel example topic management privileges can see it. gablbart last edited by Hi guys, As you can see, I'm new here, and also quite qaxobject example new to Qt. I'm using it for my BSc thesis since one month. To my problem: I'm working with sensors, I got a dll for, built with VC++, which provides COM-objects. There's also an IDL file,
Qaxcontainer
but no headers. The dumpcpp-approach did not work, as one method returned a null-pointer, so I'm now just using the QAxObjects and dynamicCalls. Queries with one parameter like: @int setup = dm->dynamicCall("Setup(const int&)",0).toInt();@ worked fine. No I want to call a method with several parameters, defined in the IDL like this: @[id(9), helpstring("method GetQuants")] HRESULT GetQuants(LONG SrcIndex, LONG Count, VARIANT* Buffer, LONG DstIndex);@ The VC++ example provided with the dll, does it like activeqt this: @component->GetQuants(0, count, &buffer, 0);@ When I use: @QList
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers 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 community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up QAxBase dynamicCall with pointer parameters up https://forum.qt.io/topic/4742/edit-activeqt-dynamiccall-error-bad-parameter-count-despite-the-right-number vote 1 down vote favorite i'm using an ActiveX COM Object and i have to call this method with dynamicCall GetFlyerTemperature(Float* pFront, Float* pBack, Boolean bOvertemp) This is my code: QVariant pFront, pBack, bOverTemp; m_wmCom->dynamicCall("GetFlyerTemperature(Float* pFront, Float* pBack, Boolean bOvertemp)", pFront, pBack, bOverTemp); but i have this error: QAxBase: Error calling IDispatch member GetFlyerTemperature: Type mismatch in parameter 0 windows qt activex share|improve this question edited Jan http://stackoverflow.com/questions/28044152/qaxbase-dynamiccall-with-pointer-parameters 20 '15 at 11:26 CSchulz 4,55083578 asked Jan 20 '15 at 11:23 Lorenz1995 61 You should not insert the arguments' names in the function signature when using dynamicCall. –Nejat Jan 20 '15 at 11:50 so do i have to write only GetFlyerTemperature(Float* , Float* , Boolean) ?? but i think that the problem is the float pointer because QVariant doesn't have float pointer with type.. –Lorenz1995 Jan 20 '15 at 13:11 Try to generate the documentation for the activex using QAxBase::​generateDocumentation(). You can then see then the signature of all functions in the generated document. –Nejat Jan 20 '15 at 13:32 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote I have resolved using this method in order to read the functions implementations: m_wmCom->generateDocumentation() So i have called: QVariantist params; QVariant res = m_com->dynamicCall("GetFlyerTemperature(double&, double&, int&)", params); share|improve this answer answered Jan 20 '15 at 14:21 Lorenz1995 61 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as
can access a PCI card. I want to build http://www.qtcentre.org/archive/index.php/t-43260.html a GUI to control this card. I use dumpcpp http://www.qtforum.org/article/22557/2/activeqt-excel.html to create a "dospotpc.h" and "dospotpc.cpp" file: dumpcpp {74676A0F-BB65-48A0-8044-F453692E9A8A} -o dospotpc in file "dospotpc.h" /************************************************** ************************** ** ** Namespace DOSPOTPCLib generated by dumpcpp from type library ** C:\Program Files\DoSpotPC.OCX\DoSpotPC.ocx ** ************************************************** **************************/ #ifndef QAX_DUMPCPP_DOSPOTPCLIB_H #define QAX_DUMPCPP_DOSPOTPCLIB_H // Define this error calling symbol to __declspec(dllexport) or __declspec(dllimport) #ifndef DOSPOTPCLIB_EXPORT #define DOSPOTPCLIB_EXPORT #endif #include
QtForum.org » Qt » Qt Programming » ActiveQt + Excel Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here. 1 2 3 Skip user information mchara Trainee Posts: 99 Location: Poland Occupation: developer 21 Friday, December 14th 2007, 7:57am what is EXCEL97, is it UUID of activeX control or "Excel.Application"? try to call activate() - all office automation objects shall open host application if QAxObject has connected to activeX server, it's simplest way to check if you're really connected to application(not some subObject). Are u using VisualStudio? mc Go to the top of the page Skip user information Aki-Matti Beginner Posts: 17 22 Tuesday, December 18th 2007, 8:13am Quoted Originally posted by mchara what is EXCEL97, is it UUID of activeX control or "Excel.Application"? try to call activate() - all office automation objects shall open host application if QAxObject has connected to activeX server, it's simplest way to check if you're really connected to application(not some subObject). Are u using VisualStudio? EXCEL97 is the UUid of the ActiveX control Source code 1 #define EXCEL97 "{00020820-0000-0000-C000-000000000046}" And yes, I am using Visual Studio.I tried the Activate command, but nothing showed up. It seems to show up only with Excel XP... Go to the top of the page Skip user information mchara Trainee Posts: 99 Location: Poland Occupation: developer 23 Tuesday, December 18th 2007, 8:44am Try this one - the best method(as for me) to investigate activeX interfaces: open new project in C# there's references item in solution right-click it and add excel's activeX when you double click added excels control you'll get interfaces browser. You can compare there if methods and subobjects are the same. mc Go to the top of the page Skip user information Aki-Matti Beginner Posts: 17 24 Tuesday, December 18th 2007, 11:14am I did as you told me and found there shou