-4

I am looking to make a program using CreateDirectory(), RemoveDirectory(), and similar functions. One of the possible return errors from these commands ERROR_ALREADY_EXISTS. I want an if statement to catch this error and post a message on the screen and continue.

Jacob Sedore
  • 25
  • 1
  • 5

1 Answers1

0

You need to call GetLastError () and check to see if the error condition meets ERROR_ALREADY_EXISTS; after calling CreateDirectory() and when it returns 0.

rakib_
  • 126,245
  • 3
  • 18
  • 26