UnlimitedMeals
UnlimitedMeals

Reputation: 131

Microsoft MapPoint 18.0 object library in VB 6.0

I am using Microsoft MapPoint 18.0 object library as a reference in VB 6.0 . After creating an object and passing the address parameters , the program doesnt return any latitude,longitude data for any valid address. was wondering if this is a dll issue for VB 6.0 ?

Upvotes: 0

Views: 580

Answers (1)

Gord Thompson
Gord Thompson

Reputation: 123584

I just did a quick test using the reference "Microsoft MapPoint 19.0 Object Library (North America)" and the following code worked for me:

Private Sub Command1_Click()
Dim mmpApp As MapPoint.Application, mmpMap As MapPoint.Map, _
        mmpFindResults As MapPoint.FindResults

Set mmpApp = New MapPoint.Application
Set mmpMap = mmpApp.ActiveMap

Set mmpFindResults = mmpMap.FindAddressResults( _
        "24 Sussex Drive", _
        "Ottawa", _
        "", _
        "ON", _
        "", _
        MapPoint.GeoCountry.geoCountryCanada)

If mmpFindResults.ResultsQuality = geoFirstResultGood Then
    MsgBox "First result returned: (" & mmpFindResults(1).Latitude & "," & _
            mmpFindResults(1).Longitude & ")"
Else
    MsgBox "The search returned poor, ambiguous, or non-existent results"
End If

Set mmpFindResults = Nothing
Set mmpMap = Nothing
Set mmpApp = Nothing
End Sub

I expect that it would also work under the 18.0 version.

Upvotes: 3

Related Questions