Click here to Skip to main content
15,898,134 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Try-catch works with structured exception Pin
George_George22-Jan-08 14:19
George_George22-Jan-08 14:19 
GeneralRe: Try-catch works with structured exception Pin
Stephen Hewitt22-Jan-08 12:42
Stephen Hewitt22-Jan-08 12:42 
GeneralRe: Try-catch works with structured exception Pin
George_George22-Jan-08 14:20
George_George22-Jan-08 14:20 
GeneralRe: Try-catch works with structured exception Pin
Stephen Hewitt22-Jan-08 16:36
Stephen Hewitt22-Jan-08 16:36 
GeneralRe: Try-catch works with structured exception Pin
George_George22-Jan-08 18:05
George_George22-Jan-08 18:05 
GeneralRe: Try-catch works with structured exception Pin
Stephen Hewitt22-Jan-08 18:21
Stephen Hewitt22-Jan-08 18:21 
GeneralRe: Try-catch works with structured exception Pin
George_George22-Jan-08 23:13
George_George22-Jan-08 23:13 
GeneralRe: Try-catch works with structured exception Pin
George_George23-Jan-08 0:48
George_George23-Jan-08 0:48 
Hi Steve,


Sorry for interrupting you again. I have tested that structured exception could also trigger stack unwinding, looks like either you are wrong or my understanding is not correct?

Here is my code,

#include <iostream>

using namespace std;

class Foo
{
public:
	Foo()
	{
		cout << "constructing Foo" << endl;
	}

	virtual ~Foo()
	{
		cout << "destrucing Foo" << endl;
	}

};

int main()
{
	int* address = NULL;

	try{

		Foo foo1;
		(*address) = 1024;
	} catch (...)
	{
		cout << "access violation caught" << endl;
	}
	return 0;
}
</iostream>


Output:

constructing Foo
destructing Foo
access violation caught


regards,
George
GeneralLock whole screen Pin
baerten21-Jan-08 22:45
baerten21-Jan-08 22:45 
GeneralRe: Lock whole screen Pin
Iain Clarke, Warrior Programmer21-Jan-08 22:51
Iain Clarke, Warrior Programmer21-Jan-08 22:51 
GeneralRe: Lock whole screen Pin
baerten21-Jan-08 23:08
baerten21-Jan-08 23:08 
GeneralRe: Lock whole screen Pin
Rajesh R Subramanian21-Jan-08 23:37
professionalRajesh R Subramanian21-Jan-08 23:37 
GeneralRe: Lock whole screen Pin
baerten21-Jan-08 23:41
baerten21-Jan-08 23:41 
GeneralRe: Lock whole screen Pin
David Crow22-Jan-08 2:53
David Crow22-Jan-08 2:53 
GeneralRe: Lock whole screen Pin
Don Box21-Jan-08 23:05
Don Box21-Jan-08 23:05 
GeneralRe: Lock whole screen Pin
baerten21-Jan-08 23:09
baerten21-Jan-08 23:09 
GeneralRe: Lock whole screen Pin
Don Box21-Jan-08 23:13
Don Box21-Jan-08 23:13 
GeneralRe: Lock whole screen Pin
Rajesh R Subramanian21-Jan-08 23:22
professionalRajesh R Subramanian21-Jan-08 23:22 
GeneralRe: Lock whole screen Pin
Don Box21-Jan-08 23:26
Don Box21-Jan-08 23:26 
GeneralRe: Lock whole screen Pin
baerten21-Jan-08 23:38
baerten21-Jan-08 23:38 
GeneralRe: Lock whole screen Pin
Rajesh R Subramanian21-Jan-08 23:43
professionalRajesh R Subramanian21-Jan-08 23:43 
GeneralRe: Lock whole screen Pin
baerten21-Jan-08 23:48
baerten21-Jan-08 23:48 
GeneralRe: Lock whole screen Pin
Don Box21-Jan-08 23:53
Don Box21-Jan-08 23:53 
GeneralRe: Lock whole screen Pin
baerten22-Jan-08 0:10
baerten22-Jan-08 0:10 
GeneralRe: Lock whole screen Pin
Don Box22-Jan-08 0:22
Don Box22-Jan-08 0:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.