-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
  • 37
  • 1
  • 6

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_
  • 136,911
  • 4
  • 20
  • 26