Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/133.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
重写或更改C++; 是否有任何方法可以重写或更改C++中的ExtPoalEngy函数,当我调用函数时,它将进入我的代码? 我想把函数的地址放进去,但我不知道怎么做? 有什么建议我可以这样做吗?_C++_Function_C++11_Overriding - Fatal编程技术网

重写或更改C++; 是否有任何方法可以重写或更改C++中的ExtPoalEngy函数,当我调用函数时,它将进入我的代码? 我想把函数的地址放进去,但我不知道怎么做? 有什么建议我可以这样做吗?

重写或更改C++; 是否有任何方法可以重写或更改C++中的ExtPoalEngy函数,当我调用函数时,它将进入我的代码? 我想把函数的地址放进去,但我不知道怎么做? 有什么建议我可以这样做吗?,c++,function,c++11,overriding,C++,Function,C++11,Overriding,你有。 我刚刚试过这个,它可以工作,至少对于正常的程序终止: void at_exit_handler() { MessageBox(NULL, L"Howdy", L"Howdy", MB_OK); } // register the exit function at program start: std::atexit(at_exit_handler); 如果要拦截ExitProcess调用并阻止正常的退出过程,您可能需要查看。这对ExitProcess不起作用,我的意思是用我的

你有。 我刚刚试过这个,它可以工作,至少对于正常的程序终止:

void at_exit_handler() {
    MessageBox(NULL, L"Howdy", L"Howdy", MB_OK);
}

// register the exit function at program start:
std::atexit(at_exit_handler);

如果要拦截ExitProcess调用并阻止正常的退出过程,您可能需要查看。

这对ExitProcess不起作用,我的意思是用我的函数替换ExitProcess函数,以便进程不会退出。我明白了。添加信息。你认为你为什么需要这样做?