Results 1 to 7 of 7

Thread: [SOLVED] ESRI's MapObjects ActiveX control, MouseMove Event in ActiveQT

  1. #1
    Join Date
    Feb 2006
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default [SOLVED] ESRI's MapObjects ActiveX control, MouseMove Event in ActiveQT

    Hi,

    I'm using Qt4.1 commercial with Visual Studio .NET 2003 integration.
    I've done a simple demo app inserting ESRI's MapObjects2.2 ActiveX
    Control inside a form as a QAxWidget with QtDesigner in Visual Studio.

    I connect signal Click() from MapObjects control (ui.mapControl) to a
    slot and it works ok.
    The code:

    connect(ui.mapControl, SIGNAL(Click()),this, SLOT(showClick()));

    I also connect the MouseMove MapObjects signal to another slot, the code:

    connect(ui.mapControl, SIGNAL(MouseMove(int,int,int,int)),this,
    SLOT(showMove(int,int,int,int)));

    But, when i run the app, and enter inside the ActiveX control moving the
    mouse the output shows (one line per mouse move):

    First-chance exception at 0x7c81eb33 in PILOT.exe: Microsoft C++
    exception: COleException @ 0x0012f8ac.

    I've debugged and see that never enter in the slot code, neither in the
    moc'ed cpp code.

    I've logged the MouseMove signal inside QT's ActiveX Control Test
    Container (%QTDIR%\tools\activeqt\testcon\release\testcon) to see the
    exact signature and it shows:

    MapObjects 2.2 Map Control: MouseMove(int,int,int,int) - { 0, 0, 449, 281 }

    MapObjects 2.2 Map Control: MouseMove(int,int,int,int) - { 0, 0, 449, 282 }

    MapObjects 2.2 Map Control: MouseMove(int,int,int,int) - { 0, 0, 444, 288 }

    MapObjects 2.2 Map Control: MouseMove(int,int,int,int) - { 0, 0, 445, 289 }

    MapObjects 2.2 Map Control: MouseMove(int,int,int,int) - { 0, 0, 436, 313 }

    MapObjects 2.2 Map Control: MouseMove(int,int,int,int) - { 0, 0, 424, 371 }
    ....
    ....


    Any ideas? I've tried also to initialize the ActiveX control using the
    QAxWidget constructor instead of "setControl" method but the results are
    the same....

    Any help or hint would be very appreciated

    Thanks everybody for your time!


    Carlos.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ESRI's MapObjects ActiveX control, MouseMove Event in ActiveQT

    Maybe you have to enable the mouse tracking?
    Qt Code:
    1. ui.mapControl->setMouseTracking( true );
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Feb 2006
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ESRI's MapObjects ActiveX control, MouseMove Event in ActiveQT

    Thanks jacek but I already tried that and didn't work!

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ESRI's MapObjects ActiveX control, MouseMove Event in ActiveQT

    Did you try to catch that exception to see what it exactly is? Maybe you should check that testcon program sources to see how it does this?

  5. #5
    Join Date
    Feb 2006
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ESRI's MapObjects ActiveX control, MouseMove Event in ActiveQT

    I see difficult to catch that exception since the slots invocation are inside the metaobject code ??

    I'll give a try looking inside testcon source


    Thanks!

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ESRI's MapObjects ActiveX control, MouseMove Event in ActiveQT

    Quote Originally Posted by crey
    I see difficult to catch that exception since the slots invocation are inside the metaobject code ??
    Maybe debugger will help you with that?

  7. #7
    Join Date
    Feb 2006
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up [SOLVED] Re: ESRI's MapObjects ActiveX control, MouseMove Event in ActiveQT

    Hi again!

    Thanks jaceck, I looked at the testcon source and solved my problem connecting the QAxBase::signal to a Slot and selecting the appropiate action in the slot analyzing and parsing the signal parameters ActiveX control fired.

    Here's a snippet:

    connect(ui.mapControl, SIGNAL(signal(const QString&, int, void*)), this, SLOT(logSignal(const QString&, int, void*)));

    void PILOTO::logSignal(const QString &signal, int argc, void *argv)
    {
    if (signal.contains("MouseUp"))
    mouseUp();
    ...
    ...


    Thanks for your time jaceck!

    Carlos.

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.