'GetTempPathW' : is not a member of 'System::IO::Path'

  • Thread starter Thread starter vve
  • Start date Start date
V

vve

Hi,

when I compile the following statement..

this->_FileDirectory = System::IO::Path::GetTempPath();

I always get this error:
Error 1 error C2039: 'GetTempPathW' : is not a member of
'System::IO::Path'

Any ideas?

Thanks,
Volker
 
when I compile the following statement..
this->_FileDirectory = System::IO::Path::GetTempPath();

I always get this error:
Error 1 error C2039: 'GetTempPathW' : is not a member of
'System::IO::Path'

Any ideas?

I presume its a conflict with the preprocessor definition in the
windows header files.

Try #undef GetTempPath in your source after the windows header files
are included.

Dave
 
Thanks David,

Your workaround helped!
But I still think, that this is a compiler error as I'm fully
qualifying the namespace.

Cheers,
Volker
 
vve said:
Thanks David,

Your workaround helped!
But I still think, that this is a compiler error as I'm fully
qualifying the namespace.

Cheers,
Volker

Volkrt:

It doesn't matter. The windows headers use #define, which does not know
about namespaces (or anything much, really).

If the .NET library had been designed with any consideration for mixed
mode programming, then it would not have used names that were subject to
this kind of substitution.

<gratuitous>
And if C++ had had more influence on .NET in general, the latter would
have const and proper RAII, and C# would be a much better language.
</gratuitous>
 
Back
Top