Private Declare Function CallProc Lib "user32" Alias "CallWindowProcA" (ByVal lpFunc As Long, ByVal p1 As Long, ByVal p2 As Long, ByVal p3 As Long, ByVal p4 As Long) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As LongFunction UnRegisterOcxOrDll(ByVal strFileName As String) As Boolean
Dim hDLL As Long
Dim pFunc As Long
Dim nRet As Long
hDLL = LoadLibrary(strFileName)
UnRegisterOcxOrDll = True
If hDLL <= 0 Then
    UnRegisterOcxOrDll = False
    Exit Function
End If
pFunc = GetProcAddress(hDLL, "DllUnregisterServer")
If pFunc <= 0 Then
    UnRegisterOcxOrDll = False
    Exit Function
End If
nRet = CallProc(pFunc, 0, 0, 0, 0)
FreeLibrary hDLL
End Function
Function RegisterOcxOrDll(ByVal strFileName As String) As Boolean
Dim hDLL As Long
Dim pFunc As Long
Dim nRet As Long
hDLL = LoadLibrary(strFileName)
RegisterOcxOrDll = True
If hDLL <= 0 Then
    RegisterOcxOrDll = False
    Exit Function
End If
pFunc = GetProcAddress(hDLL, "DllRegisterServer")
If pFunc <= 0 Then
    RegisterOcxOrDll = False
    Exit Function
End If
nRet = CallProc(pFunc, 0, 0, 0, 0)
FreeLibrary hDLL
End Function
'使用方法
Private Sub Form_Load()
Dim bOK As Boolean
bOK = RegisterOcxOrDll("prjsyshook.dll")
If bOK Then
    MsgBox "注册成功"
Else
    MsgBox "注册失败"
End IfbOK = UnRegisterOcxOrDll("prjsyshook.dll")
If bOK Then
    MsgBox "取消注册成功"
Else
    MsgBox "取消注册失败"
End If
End Sub
---------------------------------------------------
以上代码用于注册ACTIVEX控件,完全使用代码注册。
使用VB做安装包,比较容易,只要按照向导,一步一步来就可以了
在按照向导中数据库也可以放在安装包里面。
使用VC。NET开发的程序,需要msvcr70.dll这个DLL,它可能在安装向导
不会自动加上去,你需要自己手动添加上去。如果还有什么问题,可以把它压缩成ZIP文件发给我,我来告诉你怎么做。