Click to See Complete Forum and Search --> : ReadDirectoryChangesW ???
August 30th, 1999, 04:01 PM
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.
Paul McKenzie
August 30th, 1999, 05:03 PM
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
September 2nd, 1999, 06:38 PM
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.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.