CreateDirectory function

I'm using the CreateDirectory function:

BOOL WINAPI CreateDirectory(
_In_ LPCTSTR lpPathName,
_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
);

It's working fine in visualstudio debug mode, but if i switch to release, create the exe file and run the exe nothing happens.

any ideas?
A number of things could be going wrong, but most of them are due to the same probability: the current working directory is not what you think it is when you run the program in release mode.

Make sure to either:
1) set the current working directory before using CreateDirectory(), or
2) supply the full path of the new directory as argument

Also, check the return value to make sure nothing went wrong. If CreateDirectory() returns false, look at the return value of GetLastError().

Hope this helps.
I'm using createdirectory in a qt project. i have an explorer window for selecting a folder/path and then call the createdirectory funtion with the selected path. so it's always the full path and doesn't depend on the working directory
Hmm, alas, I don't know what is wrong. What do the error codes say?

Since you are using Qt, why not manage directories with the QDir methods?
Topic archived. No new replies allowed.