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(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim rkCLSID As RegistryKey =
Registry.Classe sRoot.OpenSubKe y("CLSID")
Dim strKey As String
Dim strSys32 As String =
Environment.Get FolderPath(Envi ronment.Special Folder.System) & "\"
For Each strKey In rkCLSID.GetSubK eyNames
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.OpenSub Key(strKey &
"\InprocServer3 2")
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(str Path) Then
' file doesnt exist add to listbox
lstMissingDll.I tems.Add(strPat h)
End If
End If
Catch
End Try
Next
End Sub
End Class
Ken
------------------------
"DazedAndConfus ed" <Ac********@yah oo.com> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
How would you check in an application for missing dll's so that the
application would inform the user what is wrong?