
VB实时错误94,无效使用null,跪求vb6.0高手帮忙
代码如下PrivateSubTimer2_Timer()Dimps,s$,jj%s=Text3.TextIfs=""ThenExitSubForEachpsInGetOb...
代码如下
Private Sub Timer2_Timer()
Dim ps, s$, jj%
s = Text3.Text
If s = "" Then Exit Sub
For Each ps In GetObject("winmgmts:\\.\root\cimv2:win32_process").instances_
If UCase(ps.Name) = UCase(s) Then
jj = InStrRev(ps.executablepath, "\") & ""
Text4.Text = Mid(ps.executablepath, 1, jj - 1)
Command35.Value = True
Exit For
End If
Next
End Sub 展开
Private Sub Timer2_Timer()
Dim ps, s$, jj%
s = Text3.Text
If s = "" Then Exit Sub
For Each ps In GetObject("winmgmts:\\.\root\cimv2:win32_process").instances_
If UCase(ps.Name) = UCase(s) Then
jj = InStrRev(ps.executablepath, "\") & ""
Text4.Text = Mid(ps.executablepath, 1, jj - 1)
Command35.Value = True
Exit For
End If
Next
End Sub 展开
1个回答
展开全部
jj = InStrRev(ps.executablepath, "\")
Text4.Text = Mid(ps.executablepath, 1, jj - 1) & ""
Text4.Text = Mid(ps.executablepath, 1, jj - 1) & ""
更多追问追答
追问
还是不行,我vb里面直接先运行测试,他报无效使用null
并且标示在这句上,请问这句有什么问题吗?
jj = InStrRev(ps.executablepath, "\")
追答
ps.executablepath的值为NULL?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询