diff options
Diffstat (limited to 'lib/IFileOperation/file_op.cpp')
-rw-r--r-- | lib/IFileOperation/file_op.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/IFileOperation/file_op.cpp b/lib/IFileOperation/file_op.cpp index 8024ab91..3d7717f4 100644 --- a/lib/IFileOperation/file_op.cpp +++ b/lib/IFileOperation/file_op.cpp @@ -24,7 +24,7 @@ void moveToRecycleBin(const wchar_t* fileNames[], //throw ComError { ComPtr<IFileOperation> fileOp; ZEN_CHECK_COM(::CoCreateInstance(CLSID_FileOperation, //throw ComError - NULL, + nullptr, CLSCTX_ALL, IID_PPV_ARGS(fileOp.init()))); @@ -45,7 +45,7 @@ void moveToRecycleBin(const wchar_t* fileNames[], //throw ComError //create file/folder item object ComPtr<IShellItem> psiFile; HRESULT hr = ::SHCreateItemFromParsingName(fileNames[i], - NULL, + nullptr, IID_PPV_ARGS(psiFile.init())); if (FAILED(hr)) { @@ -55,7 +55,7 @@ void moveToRecycleBin(const wchar_t* fileNames[], //throw ComError throw ComError(std::wstring(L"Error calling \"SHCreateItemFromParsingName\" for file:\n") + L"\"" + fileNames[i] + L"\".", hr); } - ZEN_CHECK_COM(fileOp->DeleteItem(psiFile.get(), NULL)); + ZEN_CHECK_COM(fileOp->DeleteItem(psiFile.get(), nullptr)); ++operationCount; } @@ -80,7 +80,7 @@ void copyFile(const wchar_t* sourceFile, //throw ComError { ComPtr<IFileOperation> fileOp; ZEN_CHECK_COM(::CoCreateInstance(CLSID_FileOperation, //throw ComError - NULL, + nullptr, CLSCTX_ALL, IID_PPV_ARGS(fileOp.init()))); @@ -96,7 +96,7 @@ void copyFile(const wchar_t* sourceFile, //throw ComError ComPtr<IShellItem> psiSourceFile; { HRESULT hr = ::SHCreateItemFromParsingName(sourceFile, - NULL, + nullptr, IID_PPV_ARGS(psiSourceFile.init())); if (FAILED(hr)) throw ComError(std::wstring(L"Error calling \"SHCreateItemFromParsingName\" for file:\n") + L"\"" + sourceFile + L"\".", hr); @@ -113,14 +113,14 @@ void copyFile(const wchar_t* sourceFile, //throw ComError ComPtr<IShellItem> psiTargetFolder; { HRESULT hr = ::SHCreateItemFromParsingName(targetFolder.c_str(), - NULL, + nullptr, IID_PPV_ARGS(psiTargetFolder.init())); if (FAILED(hr)) throw ComError(std::wstring(L"Error calling \"SHCreateItemFromParsingName\" for folder:\n") + L"\"" + targetFolder + L"\".", hr); } //schedule file copy operation - ZEN_CHECK_COM(fileOp->CopyItem(psiSourceFile.get(), psiTargetFolder.get(), targetFileNameShort.c_str(), NULL)); + ZEN_CHECK_COM(fileOp->CopyItem(psiSourceFile.get(), psiTargetFolder.get(), targetFileNameShort.c_str(), nullptr)); //perform actual operations ZEN_CHECK_COM(fileOp->PerformOperations()); |