Confused by VBWorld-tip...
Sample found on VBWorld - looks very nifty, but: Reference docs state the DLL having the functions used below is named "DbgHelp.dll", not "ImageHlp.dll". Any expert out there who may throw some light on all this?
The tip (by K. Moore) -
Creating Nested Directories
This one works by calling a function in the IMAGEHLP DLL... and if the directory specified doesn't exist, it creates it for you. And you can go down as many levels as you want - this function handles nested directories with ease.
To use this code, call CreatePath, passing in the path to create. The function returns True if successful.
Usage
x = CreatePath("c:\program files\new app\database\references")
Code
VB Code:
Declare Function MakeSureDirectoryPathExists Lib _
"IMAGEHLP.DLL" (ByVal DirPath As String) As Long
Public Function CreatePath(NewPath) As Boolean
'Add a trailing slash if none
If Right(NewPath, 1) <> "\" Then
NewPath = NewPath & "\"
End If
'Call API
If MakeSureDirectoryPathExists(NewPath) <> 0 Then
'No errors, return True
CreatePath = True
End If
End Function
- end tip quote.
regards everybody /lumen