|
-
Sep 7th, 2001, 06:13 PM
#1
Thread Starter
New Member
CreateDirectory
I am just starting with Win32 and have read the Win32 Help.
I want to simply create a directory on my hard drive and am trying the code below. It compiles without error, but does not create the directory:
#define WIN_32_LEAN_AND_MEAN
#include <windows.h>
int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpcmdline, int ncmdshow)
{
char dirname[] = "C:\new";
int retval = CreateDirectory(dirname, NULL);
if (retval != 0)
{
MessageBox(NULL, "Directory Created", "Success", MB_OK);
}
else
{
MessageBox(NULL, "Directory Failed", "Failure", MB_OK);
}
return (0);
}
Can someone suggest why the new directory is not created?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|