option strict on issues

starbuck
09-14-2004, 03:21 AM
Hi All

In our Vb.Net app we have set option strict to on. This produced a number of errors which we have sorted all but 1.
We still get the following error - Option Strict On disallows implicit conversions from 'System.Object' to 'MapPoint.Pushpin'.

In the code below

Private Sub map1_SelectionChange(ByVal sender As Object, ByVal e As AxMapPoint._IMappointCtrlEvents_SelectionChangeEve nt) Handles map1.SelectionChange

Dim SP As MapPoint.Shape
Dim loc As MapPoint.Location
Dim pin As MapPoint.Pushpin = e.pNewSelection
GetObj(pin.Name, pin.Symbol)

Select Case mouseBtn
Case 1
Try
If TypeOf e.pNewSelection Is MapPoint.Pushpin And Not isVeh Then
If prevCatch = 1 And LastCatch = 2 Then SetVehToJob()
loc = map1.ActiveMap.GetLocation(80, 0) 'get a location over at the arctic ocean
SP = map1.ActiveMap.Shapes.AddShape(MapPoint.GeoAutoSha peType.geoShapeRectangle, loc, 1, 1)
SP.Select()
SP.Delete()
End If
Catch ex As Exception
End Try
Case 2
'TODO
'DoFloatMenu(LastCatch)
End Select
End Sub

The error relates to - Dim pin As MapPoint.Pushpin = e.pNewSelection

Any ideas folks
Thanks in advance.

starbuck
09-16-2004, 05:36 AM
Ok, figured it out

 
Web mp2kmag.com
mapforums.com