473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Check for missing dll's

How would you check in an application for missing dll's so that the
application would inform the user what is wrong?
Nov 21 '05 #1
5 2045
Great Handle, thats how I feel most of the time.

LOL
"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?

Nov 21 '05 #2
Hence the name.
"Mr Newbie" <he**@now.com> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
Great Handle, thats how I feel most of the time.

LOL
"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?


Nov 21 '05 #3
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?

Nov 21 '05 #4
Nice bit of code Ken
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...
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?


Nov 21 '05 #5
Wow, that gets ALL missing DLL's, thank you.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...
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?


Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dalan | last post by:
After installing an Access 97 Runtime DB on a clean drive, could not perform any OutputTo of HTML or RTF. The error message displayed was: Optional Output To Method - The formats that enable you to...
3
by: michael | last post by:
I have an object which needs the WithEvents Declaration. But some machines which it is installed on will not have the DLL. Is there an easy way to ignore the Error 'Can't find project or library'...
3
by: Boris | last post by:
I notice the following strange behavior of the applications running under ..NET Framework. Let say I have application MyApp.exe which reference assembly MyAssembly.dll. The MyAssembly.dll is...
14
by: tshad | last post by:
I am trying to set up a reusable library (business component) that I can use in a bunch of my pages. I built the file and it almost compiles, but I am not sure what I am missing. The vbc...
0
by: JohnR | last post by:
Hi all.. my application uses a custom dll which should be in the same directory as the exe file. If the dll file is missing the application immediately aborts with a "Application has generated an...
2
by: AMD4me2 | last post by:
Each time I restart computer & run Norton System Works One Button Checkup, it finds same problems: missing program files: i.e.: ....NET\FRAMEWORK\v2.0...cannot access a necessary file,...
3
by: l.green | last post by:
I have recently migrated from MS Access 2000 to MS Access 2003 and am testing all my Access apps. One app uses the Mousehook.dll which I downloaded from the web a few years ago. The .dll is in the...
5
by: mabond | last post by:
Hi Can't believe I've not been able to find the answer to this in the on-line help. I have a CheckedListBox which, via a timer control, is populated with the names of files in a network...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.