|
-
Jul 10th, 2009, 12:04 PM
#1
Thread Starter
New Member
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
-
Jul 10th, 2009, 12:17 PM
#2
Fanatic Member
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.
-
Jul 10th, 2009, 01:15 PM
#3
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 
-
Jul 10th, 2009, 01:34 PM
#4
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|