GetFileAttributes

This is a discussion on GetFileAttributes within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I want to use the GetFileAttributes function for checking if the file is a directory. The MSDN Page page ...

  1. #1
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680

    GetFileAttributes

    Hi,

    I want to use the GetFileAttributes function for checking if the file is a directory. The MSDN Page page tells me to check the return value for INVALID_FILE_ATTRIBUTES (in case of error). I'm including windows.h but still the compiler gives an error on INVALID_FILE_ATTRIBUTES. I know I can use 0xFFFFFFFF (or -1) in stead but I'd like to know where the INVALID_FILE_ATTRIBUTES is located. Can someone tell me?

    Using Windows NT 4.0 SP6 and VC++ 6.0 Pro

    Thanks in advance,
    Monster
    Last edited by Monster; 09-30-2002 at 11:10 AM.

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    I don't know for sure, the best I got from a search was this:
    http://groups.google.com/groups?hl=e...com%26rnum%3D9
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    The old version of the documenatation (that ships with VC++) deatils that return as 0xFFFFFFFF for errors.......

    As more recent versions came out, it seems this was typedef'ed for INVALID_FILE_ATTRIBUTES in WinBase.h..

    Best bet, be sure to download the most recent platform SDK...that way, the documentation on MSDN will be better mached to the decalartion in your headers

  4. #4
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680
    Thanks guys.

    And the most recent platform SDK is included in the latest Service Pack? (I'm using SP5)

  5. #5
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    >>And the most recent platform SDK is included in the latest Service Pack? (I'm using SP5)

    Dont know, but try here

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21