MemoryModule icon indicating copy to clipboard operation
MemoryModule copied to clipboard

貌似不能支持dll中产生异常

Open heheda123123 opened this issue 1 year ago • 2 comments

rt dll中产生异常的时候程序直接退出了

heheda123123 avatar Nov 27 '24 07:11 heheda123123

需要提供详细的运行环境, 操作流程, 以及日志; 并且能够可复现, 要不不知道说什么。

YuriSizuku avatar Nov 27 '24 09:11 YuriSizuku

写一个dll,里面产生并且捕获了异常

#include <exception>
#include <iostream>
#include <stdexcept>
#include <windows.h>

void inner() {
    try {
        throw std::runtime_error("xx");
    } catch (std::exception &e) {
        std::cout << "excep\n";
    }
}

extern "C" __declspec(dllexport) void aa() {
    MessageBox(0, 0, 0, 0);
    inner();
    std::cout << "aa\n";
}

然后修改项目本身的例子,调用上面导出的aa函数 image 会发现程序直接退出了,没有输出后面的aa image 如果不产生异常的情况下,能够输出aa

heheda123123 avatar Nov 27 '24 09:11 heheda123123