hello:
I get a activex controls (.OCX file) from manufacturer, this active controls can access a PCI card. I want to build a GUI to control this card. I use dumpcpp to create a "dospotpc.h" and "dospotpc.cpp" file:

dumpcpp {74676A0F-BB65-48A0-8044-F453692E9A8A} -o dospotpc

in file "dospotpc.h"
Qt Code:
  1. /****************************************************************************
  2. **
  3. ** Namespace DOSPOTPCLib generated by dumpcpp from type library
  4. ** C:\Program Files\DoSpotPC.OCX\DoSpotPC.ocx
  5. **
  6. ****************************************************************************/
  7.  
  8. #ifndef QAX_DUMPCPP_DOSPOTPCLIB_H
  9. #define QAX_DUMPCPP_DOSPOTPCLIB_H
  10.  
  11. // Define this symbol to __declspec(dllexport) or __declspec(dllimport)
  12. #ifndef DOSPOTPCLIB_EXPORT
  13. #define DOSPOTPCLIB_EXPORT
  14. #endif
  15.  
  16. #include <qaxobject.h>
  17. #include <qaxwidget.h>
  18. #include <qdatetime.h>
  19. #include <qpixmap.h>
  20.  
  21. struct IDispatch;
  22.  
  23.  
  24. // Referenced namespace
  25.  
  26. namespace DOSPOTPCLib {
  27.  
  28.  
  29. class DOSPOTPCLIB_EXPORT _DDoSpotPC : public QAxObject
  30. {
  31. public:
  32. _DDoSpotPC(IDispatch *subobject = 0, QAxObject *parent = 0)
  33. : QAxObject((IUnknown*)subobject, parent)
  34. {
  35. internalRelease();
  36. }
  37.  
  38. /*
  39.   Method AboutBox
  40.  
  41.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  42.   */
  43. inline void AboutBox();
  44.  
  45. /*
  46.   Method doGetDetectorsName
  47.  
  48.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  49.   */
  50. inline int doGetDetectorsName(int numDev, QString& DetSN1, QString& DetSN2);
  51.  
  52. /*
  53.   Method doGetDeviceNumber
  54.  
  55.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  56.   */
  57. inline int doGetDeviceNumber(int Hardware, int& numDev);
  58.  
  59. /*
  60.   Method doGetMeasureData
  61.  
  62.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  63.   */
  64. inline int doGetMeasureData(int numDev, QVariant& Xo, QVariant& Yo, QVariant& Po);
  65.  
  66. /*
  67.   Method doGetMeasureDataEx
  68.  
  69.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  70.   */
  71. inline int doGetMeasureDataEx(int numDev, double& Xo, double& Yo, double& Po);
  72.  
  73. /*
  74.   Method doGetQuadPower
  75.  
  76.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  77.   */
  78. inline int doGetQuadPower(int numDev, QVariant& PQ1, QVariant& PQ2);
  79.  
  80. /*
  81.   Method doSetHardware
  82.  
  83.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  84.   */
  85. inline int doSetHardware(int Hardware, int numDev);
  86.  
  87. /*
  88.   Method doSetSystemType
  89.  
  90.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  91.   */
  92. inline void doSetSystemType(int AppName);
  93.  
  94. /*
  95.   Method doSetWavelength
  96.  
  97.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  98.   */
  99. inline int doSetWavelength(int numDev, int Channel, int Wave);
  100.  
  101. // meta object functions
  102. static const QMetaObject staticMetaObject;
  103. virtual const QMetaObject *metaObject() const { return &staticMetaObject; }
  104. virtual void *qt_metacast(const char *);
  105. };
  106.  
  107. // skipping event interface _DDoSpotPCEvents
  108.  
  109. // Actual coclasses
  110. class DOSPOTPCLIB_EXPORT DoSpotPC : public QAxWidget
  111. {
  112. public:
  113. DoSpotPC(QWidget *parent = 0, Qt::WindowFlags f = 0)
  114. : QAxWidget(parent, f)
  115. {
  116. setControl("{74676a0f-bb65-48a0-8044-f453692e9a8a}");
  117. }
  118.  
  119. /*
  120.   Method AboutBox
  121.  
  122.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  123.   */
  124. inline void AboutBox();
  125.  
  126. /*
  127.   Method doGetDetectorsName
  128.  
  129.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  130.   */
  131. inline int doGetDetectorsName(int numDev, QString& DetSN1, QString& DetSN2);
  132.  
  133. /*
  134.   Method doGetDeviceNumber
  135.  
  136.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  137.   */
  138. inline int doGetDeviceNumber(int Hardware, int& numDev);
  139.  
  140. /*
  141.   Method doGetMeasureData
  142.  
  143.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  144.   */
  145. inline int doGetMeasureData(int numDev, QVariant& Xo, QVariant& Yo, QVariant& Po);
  146.  
  147. /*
  148.   Method doGetMeasureDataEx
  149.  
  150.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  151.   */
  152. inline int doGetMeasureDataEx(int numDev, double& Xo, double& Yo, double& Po);
  153.  
  154. /*
  155.   Method doGetQuadPower
  156.  
  157.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  158.   */
  159. inline int doGetQuadPower(int numDev, QVariant& PQ1, QVariant& PQ2);
  160.  
  161. /*
  162.   Method doSetHardware
  163.  
  164.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  165.   */
  166. inline int doSetHardware(int Hardware, int numDev);
  167.  
  168. /*
  169.   Method doSetSystemType
  170.  
  171.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  172.   */
  173. inline void doSetSystemType(int AppName);
  174.  
  175. /*
  176.   Method doSetWavelength
  177.  
  178.   For more information, see help context 0 in C:\Program Files\DoSpotPC.OCX\DoSpotPC.hlp.
  179.   */
  180. inline int doSetWavelength(int numDev, int Channel, int Wave);
  181.  
  182. // meta object functions
  183. static const QMetaObject staticMetaObject;
  184. virtual const QMetaObject *metaObject() const { return &staticMetaObject; }
  185. virtual void *qt_metacast(const char *);
  186. };
  187. ...................................
To copy to clipboard, switch view to plain text mode 

in class "DoSpotPC", this member function prototype:
Qt Code:
  1. inline int doGetDeviceNumber(int Hardware, int& numDev);
To copy to clipboard, switch view to plain text mode 
is not correct, according to the manual, this member function prototype should be
Qt Code:
  1. short doGetDeviceNumber(short Hardware, short* numDev);
To copy to clipboard, switch view to plain text mode 

I get stuck at here, the parameter 1 type should be a pointer. if I use this function like this:
Qt Code:
  1. int devNum;
  2. s->doGetDeviceNumber(1, devNum);
To copy to clipboard, switch view to plain text mode 
I will get following error:
"Error calling IDispatch member: Type mismatch in parameter 1"

please give me some help, thx.