INVALID_FILE_ATTRIBUTES not defined

When using the GetFileAttributes function to get the attributes for a given file, the compiler (in some cases) reports that INVALID_FILE_ATTRIBUTES is not defined. This is wrong because it is shown and used in the GetFileAttributes API call examples. This is due to an error in some versions of the SDK header files where this name is not defined. If you download a newer SDK, it should include the definition for INVALID_FALE_ATTRIBUTES.

You can also include this bit of code to define it if it isn't already defined:

#if !defined (INVALID_FILE_ATTRIBUTES)
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#endif

If you have any problems with this or have any more information on this issue, please use the comment system below.


Author: DPAK
Created: Nov 20 2005
Categories: C++
TechByte #90

Warning: By visiting this site and/or by using any information contained herein, you agree to the Techbytes.ca terms of use.



Add a comment about this TechByte

If you wish to add a comment regarding this TechByte, please use the form below. Please note that by submitting comments using this form you are allowing all of the information submitted to be visible on this website. Any comments submitted using this form will only be shown on the website if they are approved by the administrators of this site. IF APPROVED, COMMENTS MAY TAKE SEVERAL DAYS TO BE POSTED.

Posted By: (Optional)

Comments:


Other TechBytes: