From: AA2e72E on
[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::DirectoryInfo::DirectoryInfo(System::String ^)' : cannot convert
parameter 1 from 'System::IO::DirectoryInfo ^' 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.
From: PvdG42 on

"AA2e72E" <AA2e72E(a)discussions.microsoft.com> wrote in message
news:63BDBD22-1666-4C62-B0FE-990C729C54FE(a)microsoft.com...
> [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::DirectoryInfo::DirectoryInfo(System::String ^)' : cannot
> convert
> parameter 1 from 'System::IO::DirectoryInfo ^' 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.

Here are the appropriate active groups.

For ISO standard C++:

microsoft.public.vc.language

For C++/CLI:

microsoft.public.dotnet.languages.vc

Both groups have active "volunteer" members who are very good at what they
do, so I'm sure you'll find the help you need.


From: AA2e72E on
Thanks, I've reposted the question.

On reopening the project, I am no longer getting Error 1.

"PvdG42" wrote:

>
> "AA2e72E" <AA2e72E(a)discussions.microsoft.com> wrote in message
> news:63BDBD22-1666-4C62-B0FE-990C729C54FE(a)microsoft.com...
> > [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::DirectoryInfo::DirectoryInfo(System::String ^)' : cannot
> > convert
> > parameter 1 from 'System::IO::DirectoryInfo ^' 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.
>
> Here are the appropriate active groups.
>
> For ISO standard C++:
>
> microsoft.public.vc.language
>
> For C++/CLI:
>
> microsoft.public.dotnet.languages.vc
>
> Both groups have active "volunteer" members who are very good at what they
> do, so I'm sure you'll find the help you need.
>
>
> .
>