阅读:2111回复:1
[求助]MapX中类型为Feature赋值的问题?
<P>procedure TForm1.Map1ToolUsed(ASender: TObject; ToolNum: Smallint; X1, Y1,<BR> X2, Y2, Distance: Double; Shift, Ctrl: WordBool;<BR> var EnableDefault: WordBool);<BR>var<BR> fNewSymbol:CMapXFeature;<BR> fMapSymbol:CMapXFeature;<BR> pt:CMapXpoint;<BR> farray: array of Vehicle;<BR>begin<BR> if ToolNum=CarTool then<BR> begin<BR> pt:=CoPoint.Create;<BR> pt.Set_(X1,Y1);</P>
<P> fNewSymbol:=Map1.FeatureFactory.CreateSymbol(pt,Map1.DefaultStyle);</P> <P> fMapSymbol:=lyrMyLayer.AddFeature(fNewSymbol,EmptyParam);<BR> iVeHicleCount:=IVehicleCount+1;</P> <P> fArray[iVehicleCount].fFeature:=fMapSymbol; //这一句出现Access Violation的错误问题,请问大虾们怎么解决<BR> fArray[iVehicleCount].lSpeed:=0;<BR> fArray[iVehicleCount].dHeading:=0;<BR> fArray[iVehicleCount].sName:= 'Vehicle'+inttostr(iVehicleCount);<BR> UpdatelistCars;<BR> end;<BR>end;</P> |
|
1楼#
发布于:2006-02-14 10:15
屏蔽掉这一句试试
|
|