agealex
23rd October 2010, 09:45
I need to call some ActiveX function and one of paramters is a struct
While calling a "segmentation fault" exception raizes
//test.h
#include <ActiveQt/QAxWidget>
#include "windows.h"
#include <QMetaType>
class MapAxWidget : public QAxWidget
{
public:
MapAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
void test();
typedef struct
{
long ForeColor;
long BackgroundColor;
}TPWPalette;
}
Q_DECLARE_METATYPE(MapAxWidget::TPWPalette);
//test.cpp
MapAxWidget::MapAxWidget(QWidget* parent, Qt::WindowFlags f )
: QAxWidget(parent, f)
{
setControl({829A0FF0-B154-4CA9-AAD9-3FFF0FA875FE});
}
void MapAxWidget::test()
{
TPWPalette t1;
t1.ForeColor = 1;
t1.BackgroundColor = 1;
QVariant param1;
param1.setValue(t1);
dynamicCall("testMSg(TPWPalette pallet)",param1); //Error raizes here
// qaxbase.cpp
long QAxBase::queryInterface(const QUuid &uuid, void **iface) const
{
*iface = 0;
if (!d->ptr) { //Error shows here
}
If one could help, will be gratefull.
P.S. English is not native language, so i am sorry for mistakes
While calling a "segmentation fault" exception raizes
//test.h
#include <ActiveQt/QAxWidget>
#include "windows.h"
#include <QMetaType>
class MapAxWidget : public QAxWidget
{
public:
MapAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
void test();
typedef struct
{
long ForeColor;
long BackgroundColor;
}TPWPalette;
}
Q_DECLARE_METATYPE(MapAxWidget::TPWPalette);
//test.cpp
MapAxWidget::MapAxWidget(QWidget* parent, Qt::WindowFlags f )
: QAxWidget(parent, f)
{
setControl({829A0FF0-B154-4CA9-AAD9-3FFF0FA875FE});
}
void MapAxWidget::test()
{
TPWPalette t1;
t1.ForeColor = 1;
t1.BackgroundColor = 1;
QVariant param1;
param1.setValue(t1);
dynamicCall("testMSg(TPWPalette pallet)",param1); //Error raizes here
// qaxbase.cpp
long QAxBase::queryInterface(const QUuid &uuid, void **iface) const
{
*iface = 0;
if (!d->ptr) { //Error shows here
}
If one could help, will be gratefull.
P.S. English is not native language, so i am sorry for mistakes