Private Sub Form_Load()
Dim dCon As New Mapobjects2.DataConnection
Dim GD As Mapobjects2.GeoDataset
dCon.Database = “C:\Data\Mexico”
If dCon.Connect Then
Set GD = dCon.FindGeoDataset(“Roads”)
If GD Is Nothing Then
MsgBox “Error opening data file”
Exit Sub
Else
Dim lyr As New Mapobjects2.MapLayer
Set lyr.GeoDataset = GD
If lyr.Valid Then
Map1.Layers.Add lyr
Else
MsgBox “Invalid layer”, _
vbCritical, “Layer error”
End If
End If
Else
MsgBox “Unable to connect to Database”, _
vbCritical, “Connection error”
End If
End Sub
vc로 짠 예제를 보고있는데 잘 모르겠어요 c++로 바꿔 주실분
|