PDA

View Full Version : ActiveQt: How to pass image to ActiveX object?



AndreasSchlempp
12th February 2009, 11:29
Hi folks,
I have embedded an ActiveX control (Moving Map ActiveX Control by Global Majic Software Inc.) into my Qt (4.1.3) application successfully:


QAxWidget *moving_map = new QAxWidget(map_frame);
moving_map->setControl(QString::fromUtf8("{D5F63C24-B3D3-11D0-B8F0-0020AF344E0A}"));
and all of the following settings are working as expected:


moving_map->dynamicCall("SetObjects(1)");
moving_map->dynamicCall("SetZoomEnabled(true)");
moving_map->setProperty("ObjectHeadingLineRange", 50.0);
moving_map->dynamicCall("SetObjectHeadingLineColor(OLE_COLOR)", 0x00ff00);

BUT: now I want to set a map-image to my control. The interface description offers this function:
void SetMapPicture(LPPICTUREDISP picture);

I tried it with this:

QPixmap map_image("blabla.bmp");
/*a:*/ moving_map->dynamicCall("SetMapPicture(IPictureDisp*)", map_image);
// or
/*b:*/ moving_map->setProperty("MapPicture", map_image);

It compiles well but at runtime I get the following messages all the time:
a: QAxBase: Error calling IDispatch member SetMapPicture: Type mismatch in parameter 0.
or
b: QAxBase: Error calling IDispatch member MapPicture: Type mismatch in parameter 0.
What am I doing wrong??? What will work????

I hope that anyone can help....
Kind regards,
Andreas

AndreasSchlempp
13th February 2009, 09:43
Does nobody have a solution???

AndreasSchlempp
16th February 2009, 12:44
Still no one any idea??????