A
AA2e72E
[I would have asked this in a C++ forum but the one I found is empty!]
System.IO.Directory.CreateDirectory(path);
return System.IO.Directory.Exists(path);
I want to bury this in a C++ Win32 Project. My effort so far (that does not
work and I do not understand the error messages) is:
#using <mscorlib.dll>
using namespace System;
using namespace System::IO;
bool* _clrcall;bool CDirectory(String path)
{
DirectoryInfo d = Directory::CreateDirectory(path);
return (d.Exists(path));
}
I get
Error 1 fatal error C1190: managed targeted code requires a '/clr'
option WCALL_DLL
Error 3 error C3149: 'System::String' : cannot use this type here without a
top-level '^'
Error 4 error C2664:
'System::IO:
irectoryInfo:
irectoryInfo(System::String ^)' : cannot convert
parameter 1 from 'System::IO:
irectoryInfo ^' to 'System::String ^'
Error 5 error C2064: term does not evaluate to a function taking 1 arguments
I don't know why I am getting Error 1 as I have set Common Language Runtime
Support to
Common Language Runtime Support (/clr)
Many, many thanks.
System.IO.Directory.CreateDirectory(path);
return System.IO.Directory.Exists(path);
I want to bury this in a C++ Win32 Project. My effort so far (that does not
work and I do not understand the error messages) is:
#using <mscorlib.dll>
using namespace System;
using namespace System::IO;
bool* _clrcall;bool CDirectory(String path)
{
DirectoryInfo d = Directory::CreateDirectory(path);
return (d.Exists(path));
}
I get
Error 1 fatal error C1190: managed targeted code requires a '/clr'
option WCALL_DLL
Error 3 error C3149: 'System::String' : cannot use this type here without a
top-level '^'
Error 4 error C2664:
'System::IO:
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
parameter 1 from 'System::IO:
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
Error 5 error C2064: term does not evaluate to a function taking 1 arguments
I don't know why I am getting Error 1 as I have set Common Language Runtime
Support to
Common Language Runtime Support (/clr)
Many, many thanks.