- 积分
- 2003
- 明经币
- 个
- 注册时间
- 2003-4-30
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2003-9-29 21:35:00
|
显示全部楼层
我的cad目录下就又VL.tlb,
用下面注册了也还是不行:
Private Sub Command1_Click()
AutoRegFile ("c:\R2000\vl.tlb")
End Sub
Function AutoRegFile(FileName As String)
Dim reged As Boolean
Dim RegFile1 As String
Dim RegFile2 As String
Dim BeReg As String
Dim RetVal
BeReg = Dir(FileName)
If BeReg <> "" Then
RegFile1 = Environ("windir") & "\system\regsvr32.exe "
RegFile2 = Environ("windir") & "\system32\regsvr32.exe "
If Dir(RegFile1) <> "" Or Dir(RegFile2) <> "" Then
If Dir(RegFile1) <> "" Then
RegFile1 = RegFile1 & "/s" & " " & BeReg
RetVal = Shell(RegFile1, 1)
Else
RegFile2 = RegFile2 & "/s" & " " & BeReg
RetVal = Shell(RegFile2, 1)
End If
Else
MsgBox "找不到regsvr32.exe文件,你可能无法使用本软件!", vbCritical, "无法自动注册控件"
End If
Else
MsgBox "找不到控件文件!", vbCritical, "无法自动注册控件"
End If
End Function |
|