Click here to Skip to main content
11,923,958 members (64,857 online)
Rate this:
Please Sign up or sign in to vote.
See more: VC8.0 C++
How to create folders and sub folders in vc++? It should first check whether the current folder exists or not, if it exists, then the same folder may be used, else new folder has to be created? for instance: Images\\IpAddress\\image1.jpeg.
Please help me...
Posted 25-May-11 19:18pm
SAKryukov 26-May-11 1:34am
"Folder" is rather a metaphor for UI and for the users, at the API level this is "Directory".
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Check this link ->

Creating directory in vc++[^]
Laxmikant_Yadav 26-May-11 0:51am
My +5 : Nice Link
SP 24 26-May-11 0:54am
Thanks Laxmikant :)
SAKryukov 26-May-11 1:33am
Agree, a 5.
SP 24 26-May-11 1:35am
Thanks SAKryukov :)
Gokulnath007 26-May-11 5:40am
How to check whether it is already exists or not, if it exists, leave it as such, if it doesnt exists,then it should be created
SP 24 26-May-11 6:33am
Did you check the MSDN link and properly read it ?? No
If you are using SHCreateDirectoryEx, CreateDirectory and your directory is already exist than you receive an error message: ERROR_FILE_EXISTS.
If you want to create file recursively than use
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

You can use CreateDirectory(szDirPath,NULL) to create a directory.
Gokulnath007 22-Oct-13 7:01am
Thank u preethi...
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Using Win32 API:
- to check if directory exists, then
- to create directory if needed.

This is the MSDN article with sample using both functions.
This is codeproject solution to help you.
Good luck,
Sergey Chepurin.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151125.3 | Last Updated 14 Oct 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100