1: try
2: {
3: std::vector<int> v;
4: int i = v[0];
5: int* pTemp = NULL;
6: *pTemp = 0;
7: }
8: catch(...)
9: {
10: AfxMessageBox(L"haha");
11: }
12:
If wishing to catch such error, we can set:
1: void myInvalidParameterHandler(const wchar_t* expression,
2: const wchar_t* function,
3: const wchar_t* file,
4: unsigned int line,
5: uintptr_t pReserved)
6: {
7: throw 0;
8: }
9:
10: _invalid_parameter_handler oldHandler, newHandler;
11: newHandler = myInvalidParameterHandler;
12: oldHandler = _set_invalid_parameter_handler(newHandler);
13:
https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=101337&SiteID=210
No comments:
Post a Comment