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

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
 
D

David Lowndes

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
 
V

vve

Thanks David,

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

Cheers,
Volker
 
D

David Wilkinson

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top