Re: CreateDirectory function
Quote:
Originally Posted by
suntonphon
Hi all,
I have some question for using CreateDirectory, the question is that whe I want to create directory by using CreateDirectory shch as
Code:
CreateDirectory(L"XXX", NULL);
DWORD res = GetLastError();
the return value from GetLastError function tell me that I can create "XXX" directory successfully but I can not find "XXX" directory. Could everyone tell me that where it created?
Thnak very much
so i don't understand why aren't you designating the full path yourself. something like: L"C:\\Temp\\TestDir\\"
Re: CreateDirectory function
Hi Alin
Thank you for your reply
The path is get from user.
Re: CreateDirectory function
Unless you're using the full path name as Alin mentioned, the XXX directory will be created under the CURRENT working directory - which could possibly be anywhere...
If you start your program withing Visual Studio, at the beginning, the current working directory will be the directory containing your .sln/.vcproj files. However, if you browse for a file from within your program, the current directory may change to the folder containing the file you selected in the browse dialog.
If you run the program by double clicking on the executable (from Window Explorer), the current directory will be the folder containing the executable.
If you run the program from a desktop shortcut, the working directory will be whatever the shortcut says it should be.
THEREFORE - you really should use a full path name.
Hope that helps.
Urgent CreateDirectory issue
Hi all,
Again with CreateDirectory function, I would like to ask all of you that how can I force CreateDirectory function to not create directory in CURRENT working directory?
Thank you very much and sorry for making bord dirty.
Re: Urgent CreateDirectory issue
That question was answered in your other thread asking the same thing. Supply the full path.
Re: CreateDirectory function