Befehl für Pfad-Erstellen
-
Hallo,
kennt da jemand zufällig den Befehl?
Danke im voraus
-
Wasserwaage
Kannst Du mal genauer beschreiben, was Du möchtest.
Vieleicht CFile::GetFilePath();
kann aber nur ne Vermutung sein.
-
Hi,
über "CFileFind" schau ich nach ob ein Verzeichnis existiert. Wenn es nicht existiert, dann möchte ich es erstellen.
void MyFunc() { CFileFind finder; CString mainPath = _T("C:\\Test\\"); CString subPath = _T("SubPath"); bool PathExists = false; BOOL b = finder.FindFile(mainPath + subPath) while(b) { b = finder.FindNextFile(); PathExists = true; } if(!PathExists) { //Pfad erstellen, aber mit welchem Befehl? } }
-
Guckst Du hier:
IMAPIFolder::CreateFolder
The IMAPIFolder::CreateFolder method creates a new subfolder.Quick Info
See IMAPIFolder : IMAPIContainer.HRESULT CreateFolder( ULONG ulFolderType, LPTSTR lpszFolderName, LPTSTR lpszFolderComment, LPCIID lpInterface, ULONG ulFlags, LPMAPIFOLDER FAR * lppFolder );
-
was könnte wohl "CreateDirectory" machen ??

-
CreateDirectory ist um einfacher zu verwenden, CreateFolder ist dafür aber flexibler und mächtiger.
Grüße Rapha
-
ich will ja nicht nerven, aber wenn ich
CreateDirectory(strPath);eingebe, dann meckert der Compiler, dass er nicht einen Parameter akzeptiert. Wenn ich
Directory::CreateDirectory(strPath);eingebe - so wie es die Hilfe angibt - dann sagt der Compiler, dass er die Klasse Directory nicht kennt. Muss ich noch etwas includieren?
-
Servus,
*prügel* *schlag* *tret*

MSDN:
BOOL CreateDirectory(
LPCTSTR lpPathName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes
);Parameters
lpPathName
[in] Pointer to a null-terminated string that specifies the path of the directory to be created.
There is a default string size limit for paths of 248 characters. This limit is related to how the CreateDirectory function parses paths.To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\?\" to the path. For more information, see Naming a File.
Windows Me/98/95: This string must not exceed MAX_PATH characters.
lpSecurityAttributes
[in] Pointer to a SECURITY_ATTRIBUTES structure. The lpSecurityDescriptor member of the structure specifies a security descriptor for the new directory. If lpSecurityAttributes is NULL, the directory gets a default security descriptor. The ACLs in the default security descriptor for a directory are inherited from its parent directory.
The target file system must support security on files and directories for this parameter to have an effect. (This is indicated when GetVolumeInformation returns FS_PERSISTENT_ACLS.)CString strPath("C:\\TestPFAD"); CreateDirectory(strPath, NULL);So sollte es gehen

*winke*
Hellsgore
-
CreateDirectory("C:\\testordner",NULL);Mist zu spät!

-
JUHUUU
