473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Error using CreateDirectory

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
Nov 17 '05 #1
5 1980
"Tim" <ar********@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
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]
Nov 17 '05 #2
Possibly, do you know how I can fix that?

-Tim
-----Original Message-----
"Tim" <ar********@discussions.microsoft.com> wrote in messagenews:06****************************@phx.gbl...
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 theCreateDirectory macro in the Windows headers.
--
Jeff Partch [VC++ MVP]
.

Nov 17 '05 #3
Tim
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-----
"Tim" <ar********@discussions.microsoft.com> wrote in

message
news:06****************************@phx.gbl...
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]
.

.

Nov 17 '05 #4
<an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
news:06****************************@phx.gbl...
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?


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 Partch [VC++ MVP]
Nov 17 '05 #5
Jeff Partch [MVP] wrote:
<an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
news:06****************************@phx.gbl...
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?


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
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Frederico Caldeira Knabben | last post by:
Hello, I'm having a problem when trying to use the Directory.CreateDirectory() method. It throws a DirectoryNotFoundException exception. I'll try to illustrate it: Suppose you have the...
0
by: Daniel | last post by:
If I call CreateDirectory(\\\\devDriveA\\foo\\bar\\a\\b\\c) and \\devDriveA\foo\bar already exists then sub directories a\b\c don't get created. When I use CreateDirectory on my own file system,...
0
by: Eugene Vital | last post by:
I am trying to create a directory to a folder in a Novell directory map and it throws an error. Directory.CreateDirectory(@"\\Karibe\karibe\dev\test"); C# Error Message
1
by: H.B. | last post by:
Hi, Is there a way to avoid conflicts between CreateDirectory() (from API) and Directory::CreateDirectory(). The other functions from Directory class works(Exists() as example). It seems to be...
1
by: Steve | last post by:
Hi all, I am referring to this article in MSDN : http://msdn.microsoft.com/library/en-us/secauthn/security/logonuser.asp While creating folder on the remote machine, we are specifying the UNC...
2
by: Ross | last post by:
Hi I have an application using asp.net that I am running on my PC. The web form has a text box where you can enter a name for a new Photo category then click on the button. The code is...
5
by: Dan Lorenz | last post by:
When trying to use the function CreateDirectory on my local machine everything works fine but when I upload the page to my webhost I get an issue that it can't find path on D:\, though D:\ is what...
0
by: Edhy Rijo [Progytech] | last post by:
Hi All, I am very new to VB.NET and creating small project to that will copy all files from a DVD to a folder in the Hard Drive. While doing the copy around 30% I got the following error: ...
11
by: xenoix | last post by:
hey there, im reasonably new to C# and im currently writing a backup application which im using as a learning resource. My PC :- Visual Studio 2005 .NET Framework 2 Component Factory Krypton...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.