PDA

View Full Version : [ActiveQt] How can I get IDispatch pointer from QAxObject?



Regentag
31st March 2013, 16:17
Hello.

I'm using MapWinGIS ActiveX control.
I want to add a shp file layer to map control, and map control needs IDispatch pointer.
Shpfile is a QAxObject class. (created by dumpcpp tool.)


#include "MainWindow.h"

using namespace MapWinGIS;

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
{
QString mapPath = "ne_10m_admin_0_boundary_lines_land.shp";

ui.setupUi(this);

ui.map->SetBackColor( Qt::black);
Shapefile *sf = new Shapefile();
sf->Open( mapPath, NULL );

ui.map->AddLayer( ????? );
}


How can I get IDispatch pointer from QAxObject?


ps. Sorry for the poor English.

gloupi
29th April 2014, 18:25
Hi,

Did you find any answer ? I am having the same kind of issue with PyQt.

Regards

mazhen2009
23rd December 2017, 07:23
IUnknown *iface = 0;
activeX->queryInterface(IID_IUnknown, (void**)&iface);
if (iface) {
// use the interface
iface->Release();
}


or



IDispatch*disp= 0;
activeX->queryInterface(IID_IDispatch, (void**)&disp);
if (disp) {
// use the interface
disp->Release();
}