GetCurrentDirectory() leads to error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following statements in my code:

using namespace System::IO;
..
..
..
..
String *strFileName = Directory::GetCurrentDirectory();

When I try to compile I get the following error:

'GetCurrentDirectorryA' : is not a member of System::IO::Directory'

Well I guess that’s true, but I’m not using GetCurrentDirectioryA, nowhere
in my code is a GetCurrentDirectoryA. What I’m using is GetCurrentDirectory.
Is this Microsoft’s mistake or am I doing something wrong?
 
Hi cnickl

Ok, I'm guessing, but I think that when compiling GetDirectory is translated to GetDirectoryA or GetDirectoryW (or the translation occurs when the code runs). Any method ending with A is used for older systems, basically Win9x/ME.

Are you compiling or running the code on a Win9x/ME platform?
 
It somehow feels like you are ending up with a old win32 compilation rather
than a /clr compile.
 
cnickl said:
I have the following statements in my code:

using namespace System::IO;
.
.
.
.
String *strFileName = Directory::GetCurrentDirectory();

When I try to compile I get the following error:

'GetCurrentDirectorryA' : is not a member of System::IO::Directory'

Well I guess that’s true, but I’m not using GetCurrentDirectioryA, nowhere
in my code is a GetCurrentDirectoryA. What I’m using is GetCurrentDirectory.
Is this Microsoft’s mistake or am I doing something wrong?

You're including some old header files during the compilation,
something that contains:

#if UNICODE
#define GetCurrentDirectory GetCurrentDirectorryW
#else
#define GetCurrentDirectory GetCurrentDirectorryA
#endif

bye
Rob
 
Back
Top