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
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
directory, but your topic needs more details. Its not very clear what do you want.
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
Re: How to get the path of the dll instead of the path of exe in VB 6.0?
Ya'll must be psychic. :D
What DLL are you talking about? :confused: