搜到的一篇文章: 在程序中注册和注销 OCX 控件 作者不详声明(在本例子里使用的是 ComCtl32.OCX,如果是其他,使用相应的名称): Declare Function RegComCtl32 Lib "ComCtl32.OCX" _ Alias "DllRegisterServer" () As Long Declare Function UnRegComCtl32 Lib "ComCtl32.OCX" _ Alias "DllUnregisterServer" () As Long Const ERROR_SUCCESS = &H0使用:If RegComCtl32 = ERROR_SUCCESS Then MsgBox "Registration Successful" Else MsgBox "Registration Unsuccessful" End IfIf UnRegComCtl32 = ERROR_SUCCESS Then MsgBox "UnRegistration Successful" Else MsgBox "UnRegistration Unsuccessful" End If
WinNT or XP = <WinDIR>/Sysyem32
或
RegSvr32 /s 你的控件.ocx
(不显示提示)
在程序中注册和注销 OCX 控件
作者不详声明(在本例子里使用的是 ComCtl32.OCX,如果是其他,使用相应的名称):
Declare Function RegComCtl32 Lib "ComCtl32.OCX" _
Alias "DllRegisterServer" () As Long
Declare Function UnRegComCtl32 Lib "ComCtl32.OCX" _
Alias "DllUnregisterServer" () As Long
Const ERROR_SUCCESS = &H0使用:If RegComCtl32 = ERROR_SUCCESS Then
MsgBox "Registration Successful"
Else
MsgBox "Registration Unsuccessful"
End IfIf UnRegComCtl32 = ERROR_SUCCESS Then
MsgBox "UnRegistration Successful"
Else
MsgBox "UnRegistration Unsuccessful"
End If