Hi,
When you regsvr a file it creates a clsid. This will get the
dll names from the registry. It will add any dll that it cant find to a
listbox lstMissingDll
Imports Microsoft.Win32
Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim rkCLSID As RegistryKey =
Registry.ClassesRoot.OpenSubKey("CLSID")
Dim strKey As String
Dim strSys32 As String =
Environment.GetFolderPath(Environment.SpecialFolde r.System) & "\"
For Each strKey In rkCLSID.GetSubKeyNames
Try
' only check for dll name if it is a clsid
If strKey.IndexOf("{") >= 0 Then
Dim strPath As String
Dim rk As RegistryKey = rkCLSID.OpenSubKey(strKey &
"\InprocServer32")
Dim strDll As String = rk.GetValue("").ToString
If strDll.IndexOf("\") > 0 Then
'gave full path
strPath = strDll
Else
' in system32 directory
strPath = strSys32 & strDll
End If
Dim str As String = """"
strPath = strPath.Replace(str, "")
Trace.WriteLine(strPath)
If Not File.Exists(strPath) Then
' file doesnt exist add to listbox
lstMissingDll.Items.Add(strPath)
End If
End If
Catch
End Try
Next
End Sub
End Class
Ken
------------------------
"DazedAndConfused" <Ac********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
How would you check in an application for missing dll's so that the
application would inform the user what is wrong?