Dll VB6.0中的MicrosoftMapPoint18.0对象库

Dll VB6.0中的MicrosoftMapPoint18.0对象库,dll,vb6,mappoint,Dll,Vb6,Mappoint,我正在使用MicrosoftMapPoint18.0对象库作为VB6.0中的参考。创建对象并传递地址参数后,程序不会返回任何有效地址的纬度、经度数据。我想知道这是否是VB6.0的dll问题 我刚刚使用参考“Microsoft MapPoint 19.0对象库(北美)”做了一个快速测试,以下代码适用于我: Private Sub Command1_Click() Dim mmpApp As MapPoint.Application, mmpMap As MapPoint.Map, _

我正在使用MicrosoftMapPoint18.0对象库作为VB6.0中的参考。创建对象并传递地址参数后,程序不会返回任何有效地址的纬度、经度数据。我想知道这是否是VB6.0的dll问题

我刚刚使用参考“Microsoft MapPoint 19.0对象库(北美)”做了一个快速测试,以下代码适用于我:

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

我希望它在18.0版本下也能工作。

我刚刚使用参考“Microsoft MapPoint 19.0对象库(北美)”做了一个快速测试,以下代码对我有效:

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

我希望它在18.0版本下也能工作。

您应该能够,但我们不知道您实际在做什么。发布您的代码并描述错误所在。是否返回有效对象?你检查过他们的其他财产了吗?等等,你应该可以,但我们不知道你到底在做什么。发布您的代码并描述错误所在。是否返回有效对象?你检查过他们的其他财产了吗?等等,它应该会起作用,但我们不知道OP在做什么。我还要指出,您的代码盲目地假设至少返回一个好结果。在获取坐标信息之前,您应该检查Results集合的ResultsQuality属性。这是我看到的一个常见问题(“为什么这段代码会崩溃?”)-文档中的示例也排除了测试,这没有帮助!是的,它应该能工作,但我们不知道OP在做什么。我还要指出,您的代码盲目地假设至少返回一个好结果。在获取坐标信息之前,您应该检查Results集合的ResultsQuality属性。这是我看到的一个常见问题(“为什么这段代码会崩溃?”)-文档中的示例也排除了测试,这没有帮助!