General discussion

Locked

creation of files and folders

By jbarry47 ·
I have a couple of questions:
1)How do I create a folder in C++ ?
2)How do I create a file to be used as a data
file that will be stored in the above folder?

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Use CreateDirectory and CreateFile

by Valentino In reply to creation of files and fol ...

Use MSDN (http://msdn.microsoft.com/) to get help on CreateDirectory (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createdirectory.asp) and CreateFile (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createdirectory.asp) functions.

Just in case, here they are briefly:

BOOL CreateDirectory(
LPCTSTR lpPathName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes
);

lpPathName - pointer to directory path string;
lpSecurityAttributes - pointer to security descriptor.

HANDLE CreateFile(
LPCTSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLEhTemplateFile
);

lpFileName - pointer to name of the file;
dwDesiredAccess - access (read-write) mode (GENERIC_READ, GENERIC_WRITE);
dwShareMode - share mode (FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE);
lpSecurityAttributes - pointer to security attributes;
dwCreationDisposition - how to create (CREATE_NEW, CREATE_ALWAYS, OPEN_EXISTING, OPEN_ALWAYS, TRUNCATE_EXISTING);
dwFlagsAndAttributes - file attributes;
hTemplateFile - handle to file with attributes to copy.

Collapse -

looking for a DLL file

by wildcard27284 In reply to creation of files and fol ...

one of the programs that i use now is saying that i need a snmpap.DLL file in order to run this so how do i get this file???

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums