Results 1 to 2 of 2

Thread: Confused by VBWorld-tip...

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2001
    Posts
    46

    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:
    1. Declare Function MakeSureDirectoryPathExists Lib _
    2.     "IMAGEHLP.DLL" (ByVal DirPath As String) As Long
    3.  
    4. Public Function CreatePath(NewPath) As Boolean
    5.  
    6.     'Add a trailing slash if none
    7.     If Right(NewPath, 1) <> "\" Then
    8.         NewPath = NewPath & "\"
    9.     End If
    10.    
    11.     'Call API
    12.     If MakeSureDirectoryPathExists(NewPath) <> 0 Then
    13.         'No errors, return True
    14.         CreatePath = True
    15.     End If
    16.  
    17. End Function

    - end tip quote.

    regards everybody /lumen
    Last edited by lumen; Nov 19th, 2002 at 01:13 PM.

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