VB代码只在一台机器上崩溃(OS WIN 2008 R2)并在所有其他机器上成功运行,在我发现下面的dubugging之后

时间:2017-03-24 06:27:57

标签: vb6

  

以下是供您参考的代码......   当我点击这个时,我有一个浏览按钮我设置了列表框内容   在我在这台机器上添加了痕迹后,我发现它崩溃了   “Me.csplStyles.ListIndex = p”这一行被执行

   Private Sub cmdLineStyle_Click()
         Dim f As New frmChartElementStyles
         f.Style = LineStyle // here it perfectly returns index, 
   End Sub

   //Following function returns index successfully
   Private Property Get LineStyle() As Long
      Dim p As Object
      If Not Me.lvColumnsForProperties.SelectedItem Is Nothing Then
         Set p = m_colColumns(Me.lvColumnsForProperties.SelectedItem.key)
         LineStyle = p.LineStyle
      End If
   End Property

   Public Property Let Style(ByVal p As Long)
       **Me.csplStyles.ListIndex = p // Here it crashes**
   End Property
  

让我告诉你,这段代码在所有机器上运行良好。   只有一台机器可以解决这个问题。

0 个答案:

没有答案
相关问题