标题:[求助]“自动化错误”???
只看楼主
windboy
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-1-4
 问题点数:0 回复次数:1 
[求助]“自动化错误”???

我在VB6.0上学习开发supermap,从例子上烤下 一段代码,例子本身运行良好,

但到我的程序上就提示“实时错误:-2147417848(80010108)自动化错误”

Private Sub btnBuffer_Click() '生成Buffer
Dim objGeometry As soGeometry
Dim objGeoRegion As soGeoRegion
Dim objGeoPoint As soGeoPoint
Dim objRecordset As soRecordset
Dim objStyle As New soStyle

SuperMap.TrackingLayer.ClearEvents
With objStyle
.BrushStyle = 2
.BrushBackTransparent = True
.PenColor = vbDesktop
.PenWidth = 7
End With

If SuperMap.selection.Count = 0 Then
MsgBox "请先在图中选择一个对象!", vbInformation, "示范"
Else
Set objRecordset = SuperMap.selection.ToRecordset(True)
Set objGeometry = objRecordset.GetGeometry()
If objGeometry.Type = scgPoint Then
Set objGeoPoint = objGeometry
Set objGeoRegion = objGeoPoint.Buffer(20, 40)
ElseIf objGeometry.Type = scgRegion Then
Set objGeoRegion = objGeometry
Set objGeoRegion = objGeoRegion.Buffer(20, 40)
End If
If objGeometry Is Nothing Then
MsgBox "错误!", vbInformation, "示范"
Else
SuperMap.TrackingLayer.AddEvent objGeoRegion, objStyle, "" “实时错误:-2147417848(80010108)自动化错误


SuperMap.Refresh
End If
End If

Set objGeometry = Nothing
Set objGeoPoint = Nothing
Set objGeoRegion = Nothing
Set objRecordset = Nothing
Set objStyle = Nothing
End Sub

Private Sub btnSelect_Click()
'选择
bAnalyse = False
SuperMap.Action = scaSelect
End Sub

当运行到SuperMap.TrackingLayer.AddEvent objGeoRegion, objStyle, ""时出现以上错误

请问是怎么回事?


搜索更多相关主题的帖子: 自动化 
2006-01-04 19:32
windboy
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-1-4
得分:0 
我设了断点,逐语句运行时,可以生成缓冲区。

当我取消断点,运行时,又没的错误提示了,但是程序却死了!

没法子,只得关闭。
2006-01-04 20:10



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-41625-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.646336 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved