Hi,
I'm trying to write a function to test if a dll I'm about to use is registered or not,. I've got lots of 3rd party dlls which I use which may not be registered, so I want to call a function, where I pass it the "namespace.interface" I'm about to use and the name of the dll to use if it needs to register it.
Here's my code for 1 dll which I'm trying to replace with my function, but I don't know how to pass "FitManager.CFitManager" into my function:
Code:Dim processRegister_DLL As New Process processRegister_DLL.StartInfo.UseShellExecute = False processRegister_DLL.StartInfo.RedirectStandardOutput = True processRegister_DLL.StartInfo.WindowStyle = ProcessWindowStyle.Normal processRegister_DLL.StartInfo.CreateNoWindow = False processRegister_DLL.StartInfo.FileName = Environment.SystemDirectory & "\regsvr32" MsgBox("About to test FitManager.dll") Try Dim oFitManager_Test As New FitManager.CFitManager oFitManager_Test = Nothing MsgBox("FitManager.dll already registered") Catch ex As Exception MsgBox("FitManager.dll is not registered") MsgBox("About to register FitManager.dll") processRegister_DLL.StartInfo.Arguments = ".\FitManager.dll" processRegister_DLL.Start() processRegister_DLL.WaitForExit() If processRegister_DLL.ExitCode <> 0 Then MsgBox("Failed to Register FitManager.dll. Admin Rights are required to register a DLL") Exit Sub Else MsgBox("FitManager.dll registered OK") End If End Try




Reply With Quote
