[RESOLVED] How to detect installed components
Hi everybody ;
I was wondering if there is a method to detect if a DLL or OCX is already exist & registered , also in VB6 how can I detect that the .Net framework is installed & what version (I hope that this is not the wrong forum to ask about that). :wave:
Re: How to detect installed components
Re: How to detect installed components
Quote:
Originally Posted by Cristian
Thank you :) , but I guess that it is irrelevant , if I am wrong can anybody explain that foe me. ???
Re: How to detect installed components
For your first question:
Private Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Re: How to detect installed components
Do you mean this :
VB Code:
Option Explicit
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Sub cmdCheck_Click()
MsgBox "Exist ??? =" & CheckForComponent("user32.dll")
End Sub
Private Function CheckForComponent(ComPath As String) As Boolean
Dim Ret As Long
Ret = LoadLibrary(ComPath)
FreeLibrary Ret
If Ret = 0 Then
CheckForComponent = False
Else
CheckForComponent = True
End If
End Function
Re: How to detect installed components
Sorry : BUMP
1-Is that what you mean by the API (LoadLibrary).
2-If I want to get their versions I need to get their paths , is it possible (via registry for example).
3-About the .Net framework , should I ask in the .Net section (Note that I want to do this in VB6)
Thanks
Re: How to detect installed components
OK , I made a topic about detecting the framework : http://www.vbforums.com/showthread.php?t=435124 , it is resolved for that issue , but I still want to know about other questions plz , help
Re: How to detect installed components
OK , now my second question is also resolved , coz using APIs to get a file version need full path only for un-registered components.
So the last question Is that what you mean by the API (LoadLibrary) , RobDog888 ?, see post No.5
Please this is the remaining part of my current project :(
Re: How to detect installed components
BUMP
Nudge
Hello
Anybody can answe plz :(
Re: How to detect installed components
Yes, but user32 will exist in all windows based OS' as its a core requirement for windows to run.
The return of LoadLibrary will be non-null if it suceeds and the library exists.
See this definition and two code examples at the bottom of the page for more details and examples of its use.
http://www.allapi.net/apilist/LoadLibrary.shtml
Re: How to detect installed components
I know that and i have (API Guide) , I just used the (user32.dll) as example.
This means that this topic is RESOLVED & RobDog888 deserves a rate :)