Skip to content

Commit 1359b6f

Browse files
author
埃博拉酱
committed
20250923
1 parent 3cb304e commit 1359b6f

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed
512 Bytes
Binary file not shown.

Windows平台/SHFileOperation.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,11 @@ static String 字符串转换(Array&& 输入)
2727
}
2828
static TypedArray<bool> 执行操作(SHFILEOPSTRUCTW& 操作结构)
2929
{
30-
switch (SHFileOperationW(&操作结构))
31-
{
32-
case ERROR_SUCCESS:
33-
case ERROR_CANCELLED:
30+
int const 异常 = SHFileOperationW(&操作结构);
31+
if (异常 == ERROR_SUCCESS || 异常 == ERROR_CANCELLED)//取消操作也算成功
3432
return 数组工厂.createScalar<bool>(操作结构.fAnyOperationsAborted);
35-
case ERROR_FILE_NOT_FOUND:
36-
EnumThrow(MATLAB::Exception::File_not_found);
37-
default:
38-
ThrowLastError(MATLAB::Exception::File_operation_failed);
39-
}
33+
else
34+
EnumThrow(MATLAB::Exception::File_operation_failed, WindowsErrorMessage(异常));
4035
}
4136
static TypedArray<bool> CopyMove(matlab::mex::ArgumentList& 输入, UINT wFunc)
4237
{

0 commit comments

Comments
 (0)