home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "CommandWrapper"
- Option Explicit
-
- Sub Main()
- Dim strCommand As String, strObjectPath As String, menum As Variant
-
- On Error GoTo ErrorHandler
-
- strCommand = Trim$(Command())
- strObjectPath = Trim$(Mid(strCommand, InStr(strCommand, Chr(32))))
-
- If InStr(strCommand, "/register") <> 0 Then
- 'register object
- menum = RegisterComponent(strObjectPath, DllRegisterServer)
- If menum = [File Could Not Be Loaded Into Memory Space] Then
- MsgBox "File Could Not Be Loaded Into Memory Space", vbExclamation
- ElseIf menum = [Not A Valid ActiveX Component] Then
- MsgBox "Not A Valid ActiveX Component", vbExclamation
- ElseIf menum = [ActiveX Component Registration Failed] Then
- MsgBox "ActiveX Component Registration Failed", vbExclamation
- ElseIf menum = [ActiveX Component Registered Successfully] Then
- MsgBox "ActiveX Component Registered Successfully", vbExclamation
- End If
- ElseIf InStr(strCommand, "/unregister") <> 0 Then
- 'unregister object
- menum = RegisterComponent(strObjectPath, DllUnRegisterServer)
- If menum = [File Could Not Be Loaded Into Memory Space] Then
- MsgBox "File Could Not Be Loaded Into Memory Space", vbExclamation
- ElseIf menum = [Not A Valid ActiveX Component] Then
- MsgBox "Not A Valid ActiveX Component", vbExclamation
- ElseIf menum = [ActiveX Component Registration Failed] Then
- MsgBox "ActiveX Component Registration Failed", vbExclamation
- ElseIf menum = [ActiveX Component UnRegistered Successfully] Then
- MsgBox "ActiveX Component UnRegistered Successfully", vbExclamation
- End If
- Else
- MsgBox "Invalid Command Action", vbExclamation
- End If
-
- End
-
- ErrorHandler:
- MsgBox Err.Number & " - " & Err.Description
- End
-
- End Sub
-