CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    ReadDirectoryChangesW ???

    Does anybody know how to use the ReadDirectoryChangesW function. I looked at the FWatch sample in MSDN & it didn't seem very clear. Any simpler example would be appreciated. Also when I try to call ::ReadDirectoryChangesW from within a function in a C++ class I get the following error message while compiling in VC++ 6.0 " error C2039: 'ReadDirectoryChangesW' : is not a member of '`global namespace'' ". Any help would be appreciated. Thanks.


  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: ReadDirectoryChangesW ???

    If you look inside the "WINBASE.H" header, you will see that ReadDirectoryChangesW is defined only for Windows NT 4.0 and higher (an "#if" preprocessor definition makes sure of this). The "not a member of global namespace" error is there because the compiler could not find the prototype to the function that you are calling. Obviously, the C preprocessor skipped over the function proptotype. Therefore you are probably not running NT 4.0

    Regards,

    Paul McKenzie


  3. #3
    Guest

    Re: ReadDirectoryChangesW ???

    Thanks for your feedback. But I have defined the _WIN32_WINNT macro and also included the "winbase.h" file at the top of my .cpp file as follows

    #define _WIN32_WINNT 0x0400

    #include "winbase.h"
    #include "stdafx.h"
    #include "ATLCONV.H"

    Even then I get the same error message when compiling my .cpp file
    "error C2039: 'ReadDirectoryChangesW' : is not a member of 'global namespace'"
    . Also I have Windows NT 4.0 SP4 running on my machine. I still don't know what's happening. Thanks.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured