Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list Search Articles Add Comment Printer friendly Direct link Par2: Check directory/create directory 2002-04-05 -- Ville Vahtera I thought to share this info I found during to try solve problem for
existing/not existing directory.
I needed a chance to create directory if the dir I were looking for
didn't exist.
Well, I found pretty neet API to call from imagehlp.dll. This api will
create automaticly that directory you're looking for if it dosen't
exist.
Global map:
Module('IMAGEHLP.DLL')
MakeSureDirectoryPathExists(*CString DirPath),Long,Pascal,Raw
End
FullDirectoryName CString(255)
Usage:
FullDirectoryName = 'c:\Some_dir_I_need_to_create\'
x# = MakeSureDirectoryPathExists(FullDirectoryName)
When you call this API, it will check if the directory is there and if
there isn't any, it will create it for you :-)
...and remember to make and include imagehlp.lib for your project!
"Imagehlp.dll. On NT, requires version 4.0 or later. On Win9x, requires Windows 95 or later"
with win2000:
"Starting with Windows 2000, you can no longer redistribute the ImageHlp DLL that is included with the
operating system. A subset of
the functions have been moved to a DLL that is redistributable. Existing applications will continue to
work because ImageHlp uses
forwarders to call into the new DLL"
Today is November 21, 2024, 7:30 am This article has been viewed 35275 times.
|
|