August 17th, 2003, 11:53 AM
Checking if a directory exists (windows/C)
Is their an API to do this?
August 17th, 2003, 12:52 PM
You can use it to check if a directory exists as well. FindFirstFile() will return INVALID_HANDLE_VALUE, if the directory does not exist.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
August 17th, 2003, 04:43 PM
I'v had trouble with it.
User types directory in a Editbox,
If the dir does not exist, I get "NOT HERE", else it crashes. In my program, I have it check the end of what the user put for a "\" or "/" and add a slash if their is none, I do this AFTER checking if dir exists.
update: Ebox is just MessageBox(), GetText is SendMessage wm gettext, directory is char* and holds the text + null terminator.
August 17th, 2003, 04:56 PM
Dumb mistake, Ok thanks, it works. It needs a win23 finddata, can't be null.