Home > Back-end >  Call mapx map, in qt QAxBase: : qt_metacall: the Object is not initialized, or initializatio
Call mapx map, in qt QAxBase: : qt_metacall: the Object is not initialized, or initializatio

Time:09-16

Call in Qt mapx control, want to draw of the circular area, but at the end of a runtime exception, application output shows
QAxBase: Error calling IDispatch member GeoSet: Exception thrown by the server
Code: 1011
Source: MAPX50
Description:?????? :????????????????????????????????
Help: C: \ \ PROGRA ~ 2 MapInfo \ MAPX5 ~ 1.0 \ MAPX50 HLP [400011]
Connect to the exception (int, QString, QString, QString) signal to catch this exception
Before: 55
After: 56
QAxBase: : qt_metacall: the Object is not initialized, or initialization failed
D: \ sogou_pinyin \ SogouInput \ Components \ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Abnormal end,

When debugging, I found the interruption in the following code qt_metacall (QMetaObject: : InvokeMetaMethod, 9, _a);

The inline void CMapXPoint: : Set (double X, double Y)
{
Void * _a []={0, (void *) & amp; X, (void *) & amp; Y};
Qt_metacall (QMetaObject: : InvokeMetaMethod, 9, _a);
}


The entire function code is as follows:

CMapXPoint * pt;
CMapXFeature * drawCircular;
CMapXLayers * the layers;
CMapXLayer * layer;
CMapXStyle * style;

PCMapFeaFactory=map - & gt; FeatureFactory ();
The layers=map - & gt; The Layers ();

QDebug () & lt; <" Before: "& lt;
Bool flag=false;
for(int i=1; i<=the layers - & gt; The Count (); I++) {
Layer=the layers - & gt; The Item (I);
If (layer - & gt; The Name ()=="DetectionRange") {
flag=true;
break;
}
}
If (flag==false) {
CMapXLayer lyr. *=map - & gt; The Layers () - & gt; DetectionRange CreateLayer (" ");
The map - & gt; The Layers () - & gt; SetAnimationLayer (lyr.);
}
Layer=map - & gt; The Layers () - & gt; The Item (" DetectionRange ");

QDebug () & lt; <" After: "& lt;
Pt=drawCircular - & gt; Point ();
Pt - & gt; Set (104.65, 31.5124);

Style - & gt; SetRegionBackColor (FillPatternConstants: : miPatternNoFill);
Style - & gt; SetRegionBorderColor (ColorConstants: : miColorRed);
Style - & gt; SetRegionBorderStyle (PenStyleConstants: : miPenSolid);
Style - & gt; SetRegionBorderWidth (2);
Style - & gt; SetRegionPattern (FillPatternConstants: : miPatternNoFill);

A double v=10.0;
Int vv=1024;

DrawCircular=pCMapFeaFactory - & gt; CreateCircularRegion (CircleTypeConstants: : miCircleTypeScreen,
Pt - & gt; AsVariant (). ValueV, vv, style - & gt; AsVariant ());
Layer - & gt; AddFeature (drawCircular - & gt; AsVariant (). ValueLayer - & gt; The Refresh ();
  • Related