Error using CreateDirectory

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

Hi, I am trying to create a directory from within my
program. I found the IO::Directory::CreateDirectory
(filename) function, and used that but I get two errors
concerning CreateDirectoryA (one that it takes two
parameters, the other that it is not in IO::Directory).
Did I miss something? I am including mscorlib.dll and
using the proper namespaces.

Thanks, Tim
 
Tim said:
Hi, I am trying to create a directory from within my
program. I found the IO::Directory::CreateDirectory
(filename) function, and used that but I get two errors
concerning CreateDirectoryA (one that it takes two
parameters, the other that it is not in IO::Directory).
Did I miss something? I am including mscorlib.dll and
using the proper namespaces.

I could be wrong, but I suspect that you are being interfered with by the
CreateDirectory macro in the Windows headers.
 
Possibly, do you know how I can fix that?

-Tim
-----Original Message-----
Hi, I am trying to create a directory from within my
program. I found the IO::Directory::CreateDirectory
(filename) function, and used that but I get two errors
concerning CreateDirectoryA (one that it takes two
parameters, the other that it is not in IO::Directory).
Did I miss something? I am including mscorlib.dll and
using the proper namespaces.

I could be wrong, but I suspect that you are being interfered with by the
CreateDirectory macro in the Windows headers.
--
Jeff Partch [VC++ MVP]


.
 
Hi, I undefined the CreateDirectory macro with "#undef
CreateDirectory" and it seemed to work. Thank you for
your help.

-Tim
-----Original Message-----
Possibly, do you know how I can fix that?

-Tim
-----Original Message-----
Hi, I am trying to create a directory from within my
program. I found the IO::Directory::CreateDirectory
(filename) function, and used that but I get two errors
concerning CreateDirectoryA (one that it takes two
parameters, the other that it is not in IO::Directory).
Did I miss something? I am including mscorlib.dll and
using the proper namespaces.

I could be wrong, but I suspect that you are being interfered with by the
CreateDirectory macro in the Windows headers.
--
Jeff Partch [VC++ MVP]


.
.
 
Possibly, do you know how I can fix that?

One option would be to #ifdef/#undef CreateDirectory. Another might be to
move the function that calls IO::Directory::CreateDirectory to a translation
unit that doesn't see Windows.h. Maybe someone else could suggest a better
option.
 
Jeff said:
One option would be to #ifdef/#undef CreateDirectory. Another might
be to move the function that calls IO::Directory::CreateDirectory to
a translation unit that doesn't see Windows.h. Maybe someone else
could suggest a better option.

Those are about the only two. Sure would be nice if someday the Windows
group would produce a C++ friendly version of windows.h! (Overloaded inline
functions, anyone?)

-cd
 
Back
Top