How to create a new folder with C++ code
-
Monday, March 26, 2007 5:59 PM
Hi
I wonder, how can i create the folder c:\ZigBeeLogs\ if it don't exists yet, with a c++ code? I guess this task may be like "piece of cake" for an experienced programmer.
Best regards Bjørn Liene Gundersen
All Replies
-
Monday, March 26, 2007 6:22 PMModerator
MSDN is your friend. In future similar cases, try searching for "create directory".
_tmkdir(_T("c:\\ZigBeeLogs"); -
Monday, March 26, 2007 6:36 PM
Of course, you also have the option of using the Windows API: CreateDirectory() or CreateDirectoryEx(). -
Monday, March 26, 2007 10:51 PM
Thanks. It worked. I was searching for "create folder" at the MSDN library, and of course i should have searched "create directory", so for that reason I couldn't find it:-)
Thanks anyway.
Bjørn Liene Gundersen
-
Tuesday, March 27, 2007 3:52 AM
In addition to Bancila's comment, Create Directory will only create the directory specified at the end of the path specified. If any of the intermediate directories not existing, the API will fail.
You can use or SHCreateDirectory or SHCreateDirectoryEx API to create Intermediate directories if they're not existing. This is documented in MSDN.
- Proposed As Answer by Chaker Nakhli Friday, January 02, 2009 10:30 AM
-
Friday, January 02, 2009 4:40 AMCould u pls provide some piece of codes using the Create Directory
I m unable to create
-
Sunday, January 04, 2009 6:40 PMCreateDirectory("c:\\dir1\\dir2\\ ... \\dirn", NULL);Just don't forget to use "\\" for each "\" in the path
-
Tuesday, January 06, 2009 3:03 AMThanks for ur reply,
I ve used the same code earlier too but the folder is ot getting created.
I m using windows mobile SDK 6.0 with VC 2005
Is it a constraint that i m running my code in emulator not in device, will it create folder in emulator??
Thanks in advance -
Tuesday, January 06, 2009 10:26 AMHi
Thanks a lot, i m able to create folder now..
Please help me to open the folder from my application..
Thanks in advance -
Thursday, January 08, 2009 10:03 AMYou should read this

