Home > Visual C++ > Creating Folders/Directories Made Simple

Creating Folders/Directories Made Simple

image

I got this thread from one of my senior, while discussing about our project. Till then, I didn’t noticed any differences between SHCreateDirectoryEx() and CreateDirectory(). But now.. Yes its is.. some .. lil difference is there.

just look at the function call

for eg:

if (CreateDirectory(“c:\\Test\\Test\\Test\\Test”,NULL))
        AfxMessageBox(“Created “);

if (ERROR_SUCCESS == SHCreateDirectoryEx(NULL,”c:\\Test\\Test\\Test\\Test”,NULL))
{
    AfxMessageBox(“Created”);
}

description from MSDN is like that for SHCreateDirectoryEX()

int SHCreateDirectoryEx(HWND hwnd, LPCTSTR pszPath, SECURITY_ATTRIBUTES *psa);

BOOL CreateDirectory(LPCTSTR lpPathName,LPSECURITY_ATTRIBUTES lpSecurityAttributes );

This function creates a file system folder whose fully qualified path is given by pszPath. If one or more of the intermediate folders do not exist, they will be created as well.

for CreateDirectory() the description is like this “ This function creates a new directory”

 

Hope now you noticed the difference from the description itself. :)

 

 

True commitment begins when we decide to do it anyway.

for http://vctipsplusplus.wordpress.com/

BijU

:)

Categories: Visual C++
  1. jongampark
    January 23, 2009 at 11:01 am | #1

    Hello. I noticed your comment on my blog.
    I’m glad to hear that you liked me blog.

    I like your blog too. It is very handy to look up to solve things.
    :)

  1. No trackbacks yet.