IFileOperationNewItem Method
Declares a new item that is to be created in a specified location.
Namespace: DevCase.Win32.InterfacesAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
Function NewItem (
psiDestinationFolder As IShellItem,
dwFileAttributes As FileAttributes,
pszName As String,
pszTemplateName As String,
pfopsItem As IFileOperationProgressSink
) As HResult
Dim instance As IFileOperation
Dim psiDestinationFolder As IShellItem
Dim dwFileAttributes As FileAttributes
Dim pszName As String
Dim pszTemplateName As String
Dim pfopsItem As IFileOperationProgressSink
Dim returnValue As HResult
returnValue = instance.NewItem(psiDestinationFolder,
dwFileAttributes, pszName, pszTemplateName,
pfopsItem)
No code example is currently available or this language may not be supported.
- psiDestinationFolder IShellItem
-
Pointer to an IShellItem that specifies the destination folder that will contain the new item.
- dwFileAttributes FileAttributes
-
A bitwise value that specifies the file system attributes for the file or folder.
- pszName String
-
Pointer to the file name of the new item, for instance Newfile.txt. This is a null-terminated, Unicode string.
- pszTemplateName String
-
Pointer to the name of the template file (for example Excel9.xls) that the new item is based on,
stored in one of the following locations:
- CSIDL_COMMON_TEMPLATES. The default path for this folder is %ALLUSERSPROFILE%\Templates.
- CSIDL_TEMPLATES. The default path for this folder is %USERPROFILE%\Templates.
- %SystemRoot%\shellnew
This is a null-terminated, Unicode string used to specify an existing file of the same type as the new file,
containing the minimal content that an application wants to include in any new file.
This parameter is normally NULL to specify a new, blank file.
- pfopsItem IFileOperationProgressSink
-
Pointer to an IFileOperationProgressSink object to be used
for status and failure notifications.
If you call Advise(IFileOperationProgressSink, UInt32) for the overall operation,
progress status and error notifications for the creation operation are included there,
so set this parameter to NULL.
HResult
If this method succeeds, it returns
S_OK.
Otherwise, it returns an
HResult error code.