Results 1 to 11 of 11

Thread: [RESOLVED] How to detect installed components

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    Egypt
    Posts
    162

    Resolved [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).
    Mohammed Sayed - Egypt - Anesthetist



    =

    =

  2. #2
    Addicted Member Cristian's Avatar
    Join Date
    Jun 2006
    Posts
    228

    Re: How to detect installed components


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    Egypt
    Posts
    162

    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. ???
    Mohammed Sayed - Egypt - Anesthetist



    =

    =

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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


    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    Egypt
    Posts
    162

    Re: How to detect installed components

    Do you mean this :

    VB Code:
    1. Option Explicit
    2. Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
    3. Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
    4.  
    5. Private Sub cmdCheck_Click()
    6. MsgBox "Exist ???    =" & CheckForComponent("user32.dll")
    7. End Sub
    8.  
    9. Private Function CheckForComponent(ComPath As String) As Boolean
    10. Dim Ret As Long
    11. Ret = LoadLibrary(ComPath)
    12. FreeLibrary Ret
    13.  
    14. If Ret = 0 Then
    15.         CheckForComponent = False
    16.     Else
    17.         CheckForComponent = True
    18. End If
    19.  
    20. End Function
    Mohammed Sayed - Egypt - Anesthetist



    =

    =

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    Egypt
    Posts
    162

    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
    Mohammed Sayed - Egypt - Anesthetist



    =

    =

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    Egypt
    Posts
    162

    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
    Mohammed Sayed - Egypt - Anesthetist



    =

    =

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    Egypt
    Posts
    162

    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
    Mohammed Sayed - Egypt - Anesthetist



    =

    =

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    Egypt
    Posts
    162

    Unhappy Re: How to detect installed components

    BUMP
    Nudge
    Hello

    Anybody can answe plz
    Last edited by msayed2004; Oct 29th, 2006 at 05:06 PM.
    Mohammed Sayed - Egypt - Anesthetist



    =

    =

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    Egypt
    Posts
    162

    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
    Mohammed Sayed - Egypt - Anesthetist



    =

    =

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width