R
Russell Mangel
Hi, I am trying to create a directory on my disk wihich is 300+ characters
long.
My program does not work, can you make it go? I am using VS2003 C++.
Russell Mangel, Las Vegas, NV
// I have specified Unicode Character set in project settings
#include "stdafx.h"
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
// Assumes that you have an existing directory: C:\\A
LPCTSTR lpTemplateDirectory= _T("C:\\A");
// This is a 300+ Character Directory, ANSI is limited to 248 chars
// I think I have the \\?\ in the right place?
LPCTSTR lpNewDirectory =
_T("\\?\C:\\A\\0000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000-000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000-00000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000");
if(CreateDirectoryEx(lpTemplateDirectory, lpNewDirectory, NULL))
{
printf("Successfully created: %s", lpNewDirectory);
}
else
{
printf("Error: %d", GetLastError());
}
return 0;
}
long.
My program does not work, can you make it go? I am using VS2003 C++.
Russell Mangel, Las Vegas, NV
// I have specified Unicode Character set in project settings
#include "stdafx.h"
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
// Assumes that you have an existing directory: C:\\A
LPCTSTR lpTemplateDirectory= _T("C:\\A");
// This is a 300+ Character Directory, ANSI is limited to 248 chars
// I think I have the \\?\ in the right place?
LPCTSTR lpNewDirectory =
_T("\\?\C:\\A\\0000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000-000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000-00000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000");
if(CreateDirectoryEx(lpTemplateDirectory, lpNewDirectory, NULL))
{
printf("Successfully created: %s", lpNewDirectory);
}
else
{
printf("Error: %d", GetLastError());
}
return 0;
}