Results 1 to 3 of 3

Thread: [ActiveQt] How can I get IDispatch pointer from QAxObject?

  1. #1
    Join Date
    Mar 2013
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Question [ActiveQt] How can I get IDispatch pointer from QAxObject?

    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.)

    Qt Code:
    1. #include "MainWindow.h"
    2.  
    3. using namespace MapWinGIS;
    4.  
    5. MainWindow::MainWindow(QWidget *parent) :
    6. QMainWindow(parent)
    7. {
    8. QString mapPath = "ne_10m_admin_0_boundary_lines_land.shp";
    9.  
    10. ui.setupUi(this);
    11.  
    12. ui.map->SetBackColor( Qt::black);
    13. Shapefile *sf = new Shapefile();
    14. sf->Open( mapPath, NULL );
    15.  
    16. ui.map->AddLayer( ????? );
    17. }
    To copy to clipboard, switch view to plain text mode 

    How can I get IDispatch pointer from QAxObject?


    ps. Sorry for the poor English.

  2. #2
    Join Date
    Apr 2014
    Posts
    2
    Qt products
    Platforms
    Windows

    Default Re: [ActiveQt] How can I get IDispatch pointer from QAxObject?

    Hi,

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

    Regards

  3. #3

    Default Re: [ActiveQt] How can I get IDispatch pointer from QAxObject?

    Qt Code:
    1. IUnknown *iface = 0;
    2. activeX->queryInterface(IID_IUnknown, (void**)&iface);
    3. if (iface) {
    4. // use the interface
    5. iface->Release();
    6. }
    To copy to clipboard, switch view to plain text mode 

    or

    Qt Code:
    1. IDispatch*disp= 0;
    2. activeX->queryInterface(IID_IDispatch, (void**)&disp);
    3. if (disp) {
    4. // use the interface
    5. disp->Release();
    6. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by mazhen2009; 23rd December 2017 at 06:28.

Similar Threads

  1. Replies: 5
    Last Post: 27th July 2012, 09:02
  2. Accessing a QAxObject* from IDispatch* problem
    By vcernobai in forum Qt Programming
    Replies: 0
    Last Post: 26th January 2012, 19:51
  3. ActiveQT (QAxObject) questions
    By semajnosnibor in forum Qt Programming
    Replies: 3
    Last Post: 19th January 2012, 17:15
  4. Get the iDispatch interface of an ActiveX control
    By punkypogo in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2010, 08:00
  5. Replies: 8
    Last Post: 23rd July 2010, 08:53

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.