user-0 提问: 如何阻止WIN系统弹出一个“内存不能为read”的对话框？

回复:
user: user-0
content: 引用 5 楼 iyomumx 的回复:[quote=引用 4 楼 onlymuxia 的回复:] 怎样调用API注册异常处理函数？ 贴的链接你看了？ 引用The following functions are used in structured exception handling. AbnormalTermination Indicates whether the __try block of a termination handler terminated normally. AddVectoredContinueHandler Registers a vectored continue handler. AddVectoredExceptionHandler Registers a vectored exception handler. GetExceptionCode Retrieves a code that identifies the type of exception that occurred. GetExceptionInformation Retrieves a machine-independent description of an exception, and information about the machine state that existed for the thread when the exception occurred. RaiseException Raises an exception in the calling thread. RemoveVectoredContinueHandler Unregisters a vectored continue handler. RemoveVectoredExceptionHandler Unregisters a vectored exception handler. RtlAddGrowableFunctionTable Informs the system of a dynamic function table representing a region of memory containing code. RtlDeleteGrowableFunctionTable Informs the system that a previously reported dynamic function table is no longer in use. RtlGrowFunctionTable Reports that a dynamic function table has increased in size. SetUnhandledExceptionFilter Enables an application to supersede the top-level exception handler of each thread and process. UnhandledExceptionFilter Passes unhandled exceptions to the debugger, if the process is being debugged. VectoredHandler An application-defined function that serves as a vectored exception handler. The following functions are used only on 64-bit Windows. RtlAddFunctionTable Adds a dynamic function table to the dynamic function table list. RtlCaptureContext Retrieves a context record in the context of the caller. RtlDeleteFunctionTable Removes a dynamic function table from the dynamic function table list. RtlInstallFunctionTableCallback Adds a dynamic function table to the dynamic function table list. RtlRestoreContext Restores the context of the caller to the specified context record. 你猜用哪个？[/quote] 你猜，猜你妹啊 你直接给个函数方法名不行吗，我只是偶尔用到而已，没打算去深究，你这人怎么这么不爽快啊，是不是男人啊 不论如何，东西有用，谢谢了

user: user-0
content: 引用 7 楼 adlay 的回复:可以使用 SetUnhandledExceptionFilter 我要的就是这个，谢谢了

user: user-1
content: 有些人犯错了, 不去改正，而是希望别人不指出来.

user: user-2
content: 崩溃的时候在弹出的对话框按相应按钮进入调试，按Alt+7键查看Call Stack即“调用堆栈”里面从上到下列出的对应从里层到外层的函数调用历史。双击某一行可将光标定位到此次调用的源代码或汇编指令处，看不懂时双击下一行，直到能看懂为止。

user: user-3
content: 可以使用 SetUnhandledExceptionFilter

user: user-4
content: #include <windows.h>  VOID HACK_SEH( VOID ) {  	__asm { 		call dword ptr[exit] 	} }  int main ()  { 	int *p = 0;  	__asm { 		push HACK_SEH 		push fs:[0] 		mov	fs:[0], esp 	} 	 	*p = 4; } 非标准SEH处理 ... 不过避免弹窗足够了

user: user-5
content: 引用 4 楼 onlymuxia 的回复:怎样调用API注册异常处理函数？ 贴的链接你看了？ 引用The following functions are used in structured exception handling. AbnormalTermination Indicates whether the __try block of a termination handler terminated normally. AddVectoredContinueHandler Registers a vectored continue handler. AddVectoredExceptionHandler Registers a vectored exception handler. GetExceptionCode Retrieves a code that identifies the type of exception that occurred. GetExceptionInformation Retrieves a machine-independent description of an exception, and information about the machine state that existed for the thread when the exception occurred. RaiseException Raises an exception in the calling thread. RemoveVectoredContinueHandler Unregisters a vectored continue handler. RemoveVectoredExceptionHandler Unregisters a vectored exception handler. RtlAddGrowableFunctionTable Informs the system of a dynamic function table representing a region of memory containing code. RtlDeleteGrowableFunctionTable Informs the system that a previously reported dynamic function table is no longer in use. RtlGrowFunctionTable Reports that a dynamic function table has increased in size. SetUnhandledExceptionFilter Enables an application to supersede the top-level exception handler of each thread and process. UnhandledExceptionFilter Passes unhandled exceptions to the debugger, if the process is being debugged. VectoredHandler An application-defined function that serves as a vectored exception handler. The following functions are used only on 64-bit Windows. RtlAddFunctionTable Adds a dynamic function table to the dynamic function table list. RtlCaptureContext Retrieves a context record in the context of the caller. RtlDeleteFunctionTable Removes a dynamic function table from the dynamic function table list. RtlInstallFunctionTableCallback Adds a dynamic function table to the dynamic function table list. RtlRestoreContext Restores the context of the caller to the specified context record. 你猜用哪个？

user: user-0
content: 引用 3 楼 iyomumx 的回复:Windows API有专门做错误处理的，参见 https://msdn.microsoft.com/en-us/library/windows/desktop/ee663265(v=vs.85).aspx 的错误处理和结构化异常处理部分。 使用C++的话在msvc的支持下可以使用__try/__except语法来做结构化异常处理，C语言就需要调用API注册异常处理函数 怎样调用API注册异常处理函数？

user: user-5
content: Windows API有专门做错误处理的，参见 https://msdn.microsoft.com/en-us/library/windows/desktop/ee663265(v=vs.85).aspx 的错误处理和结构化异常处理部分。 使用C++的话在msvc的支持下可以使用__try/__except语法来做结构化异常处理，C语言就需要调用API注册异常处理函数

user: user-6
content: 这个问题就好像在大街上杀人怎样才不会被警察知道一样