Click here to Skip to main content
15,905,914 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: fopen_s problem Pin
Joe Woodbury15-May-06 8:18
professionalJoe Woodbury15-May-06 8:18 
GeneralRe: fopen_s problem Pin
Joe Woodbury15-May-06 8:17
professionalJoe Woodbury15-May-06 8:17 
GeneralRe: fopen_s problem Pin
David Crow15-May-06 8:23
David Crow15-May-06 8:23 
AnswerRe: fopen_s problem Pin
Michael Dunn15-May-06 8:44
sitebuilderMichael Dunn15-May-06 8:44 
Questionnetwork programming! Pin
farshad.f15-May-06 5:22
farshad.f15-May-06 5:22 
AnswerRe: network programming! Pin
David Crow15-May-06 5:53
David Crow15-May-06 5:53 
AnswerRe: network programming! Pin
Roger Stoltz15-May-06 6:09
Roger Stoltz15-May-06 6:09 
QuestionException handling Pin
LiYS15-May-06 5:15
LiYS15-May-06 5:15 
My recent work content involved some exception handling, __try/__except to be specific. And the following is the questions that confused me.
int filter()

{
	puts("Filter()");
	return EXCEPTION_EXECUTE_HANDLER;
}

int _tmain(int argc, _TCHAR* argv[])

{

	int a = 1;

	int *p = NULL;

	char s[10];

	__try

	{
		__try

		{
			a = 2;
			*p = a; // Raise an exception
			puts("After exception raised");
			a = 3;  // Never reached
		}
		__finally
		{
			puts("Finally");
			a = 4;
		}
	}
	__except(filter())
	{
		puts("_except");
		a = 5;
	}
	sprintf(s, "%d", a);
	puts(s);
	_getch();
	return 0;
} 

My questions focused on the return statement in exception filter function:
if it is return EXCEPTION_EXECUTE_HANDLER,why the statement a = 3; never gets excuted?
if it is return EXCEPTION_CONTINUE_EXECUTION,why the filter keeps getting called. according to MSDN EXCEPTION_CONTINUE_EXECUTION The system stops its search for a handler and returns control to the point at which the exception occurred.return control to *p = a? only to cause another same exception? what's the point here?
if it is return EXCEPTION_CONTINUE_SEARCH, the system keeps searching for exception handlers on and on and on for access violation? until the handlers were exhausted? another seemingly endless function call?



AnswerRe: Exception handling Pin
Stephen Hewitt15-May-06 15:54
Stephen Hewitt15-May-06 15:54 
QuestionActiveX control as parent Pin
Alton Williams15-May-06 4:59
Alton Williams15-May-06 4:59 
AnswerRe: ActiveX control as parent Pin
Roger Stoltz15-May-06 5:44
Roger Stoltz15-May-06 5:44 
GeneralRe: ActiveX control as parent Pin
Alton Williams16-May-06 1:53
Alton Williams16-May-06 1:53 
AnswerRe: ActiveX control as parent Pin
Roger Stoltz16-May-06 3:07
Roger Stoltz16-May-06 3:07 
GeneralRe: ActiveX control as parent Pin
Alton Williams5-Jun-06 2:16
Alton Williams5-Jun-06 2:16 
AnswerRe: ActiveX control as parent Pin
Roger Stoltz7-Jun-06 10:49
Roger Stoltz7-Jun-06 10:49 
QuestionGDI and Regions Pin
HakunaMatada15-May-06 4:47
HakunaMatada15-May-06 4:47 
Questionto locate the registry keys for Local Security Policies Pin
narayanagvs15-May-06 4:46
narayanagvs15-May-06 4:46 
Questionerror in debugging directshow filter in loading dll function Pin
yongwpi15-May-06 4:46
yongwpi15-May-06 4:46 
AnswerRe: error in debugging directshow filter in loading dll function Pin
Cedric Moonen15-May-06 4:55
Cedric Moonen15-May-06 4:55 
GeneralRe: error in debugging directshow filter in loading dll function Pin
yongwpi15-May-06 6:13
yongwpi15-May-06 6:13 
AnswerRe: error in debugging directshow filter in loading dll function Pin
Stephen Hewitt15-May-06 18:29
Stephen Hewitt15-May-06 18:29 
GeneralRe: error in debugging directshow filter in loading dll function Pin
yongwpi16-May-06 6:30
yongwpi16-May-06 6:30 
QuestionHide folder Pin
nat2kus15-May-06 4:22
nat2kus15-May-06 4:22 
AnswerRe: Hide folder Pin
David Crow15-May-06 5:55
David Crow15-May-06 5:55 
Questioncheck status CD Pin
photomatic15-May-06 4:06
photomatic15-May-06 4:06 

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.