Results 1 to 4 of 4

Thread: How to get the path of the dll instead of the path of exe in VB 6.0?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2009
    Posts
    11

    Question How to get the path of the dll instead of the path of exe in VB 6.0?

    Can someone give me the code to get the path of the dll?

    Thanks

  2. #2
    Fanatic Member Dungeon Keeper's Avatar
    Join Date
    Mar 2008
    Posts
    590

    Re: How to get the path of the dll instead of the path of exe in VB 6.0?

    I think that DLLs are installed in
    Code:
    \system32\
    directory, but your topic needs more details. Its not very clear what do you want.
    No, that wont do!

  3. #3
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: How to get the path of the dll instead of the path of exe in VB 6.0?

    Use this to dll
    Code:
    Private Const CSIDL_SYSTEM               As Long = &H25   'system folderPrivate Const 
    
    CSIDL_FLAG_MASK = &HFF00                    'mask for all possible flag values
    Private Const SHGFP_TYPE_CURRENT = &H0                    'current value for user, verify it exists
    Private Const SHGFP_TYPE_DEFAULT = &H1
    Private Const S_OK = 0
    Private Const S_FALSE = 1
    Private Const E_INVALIDARG = &H80070057                   ' Invalid CSIDL Value
    
    Private Declare Function SHGetFolderPath Lib "shfolder" _
            Alias "SHGetFolderPathA" (ByVal hWndOwner As Long, _
            ByVal nFolder As Long, ByVal hToken As Long, _
            ByVal dwflags As Long, ByVal pszPath As String) As Long
    
    
     Public Function System32Path() As String
    Dim strBuffer  As String
    Dim strPath    As String
    Dim lngReturn  As Long
    Dim lngCSIDL   As Long
    
    lngCSIDL = CSIDL_SYSTEM
     
     strPath = String(MAX_PATH, 0)
     
     ' Get the folder's path. If the
            ' "Create" flag is used, the folder will be created
            ' if it does not exist.
            '
            lngReturn = SHGetFolderPath(0, lngCSIDL, 0, SHGFP_TYPE_CURRENT, strPath)
            'lngReturn = SHGetFolderPath(0, lngCSIDL Or CSIDL_FLAG_CREATE, 0, SHGFP_TYPE_CURRENT, strPath)
    
    System32Path = Left$(strPath, InStr(1, strPath, Chr(0)) - 1)
    
     End Function
    
    Then use this:
    Private Sub Command1_Click()
    Dim DllName As String
    DllName = Dir(System32Path & "\A3dx.dll")
     If Len(DllName) > 0 Then
      MsgBox "dll found"
     Else
      MsgBox "Dll not found"
     End If
      
    End Sub
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  4. #4
    Junior Member
    Join Date
    Jul 2009
    Posts
    30

    Re: How to get the path of the dll instead of the path of exe in VB 6.0?

    Ya'll must be psychic.

    What DLL are you talking about?

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