I use the DeleteFile and CopyFile methods. Do these functions throw exceptions or just set errno and lastError? Do I need to surround this code with try and catch?
+7
A:
If you're referring to the Win32 API functions, the answer is no. No Win32 functions throw, because it is a C API.
jeffamaphone
2009-05-16 19:19:53
+2
A:
As @jeffamaphone says, they don't throw exceptions because they are C functions.
For errors, they return 0 and set an error code that you can retrieve via GetLastError()
. Neither sets errno
, because they're Windows APIs.
RichieHindle
2009-05-16 19:33:32
thanks! answers were helpful
sofr
2009-05-16 21:13:09