PDA

View Full Version : [SOLVED] ESRI's MapObjects ActiveX control, MouseMove Event in ActiveQT



crey
2nd February 2006, 12:16
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.

jacek
2nd February 2006, 15:49
Maybe you have to enable the mouse tracking?
ui.mapControl->setMouseTracking( true );

crey
2nd February 2006, 15:53
Thanks jacek but I already tried that and didn't work!

jacek
2nd February 2006, 16:02
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?

crey
2nd February 2006, 16:05
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!

jacek
2nd February 2006, 16:37
I see difficult to catch that exception since the slots invocation are inside the metaobject code ??
Maybe debugger will help you with that?

crey
3rd February 2006, 10:48
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.