Compiler error with Directory::GetCurrentDirectory()

silentreproach
silentreproach used Ask the Experts™
on
I am trying to use a std windows call,  String path= Directory::GetCurrentDirectory();   which is part of System.IO, but cannot assemble it because it cannot find #include <System>

What should be my #include statement to be able to use the getcurrentdirectory() function? The exact error is:

fatal error: Cannot open include file no such file or directory
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
You should include the .IO
<System.IO>

or
<System>
String path= IO.Directory::GetCurrentDirectory();

Author

Commented:
Either one gives the same message. do I have to include the Class System somewhere?

Commented:
yes, pick it up

Author

Commented:
I gave up on #using System.dll which requires /Clr compile option, can't find it explained anywhere to compile it correctly with VS2008. This works okay instead:

char psCurDir[256];
LPSTR CurrentPath;
GetCurrentDirectory[256], psCurDir);
CurrentPath = psCurDir;

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial