__try / __finally
-
Hi I know embedded Visual C++ compiler do not accept return statements in this __try and __finally. but i need to return different conditions(values) at different parts of the __try / __finally block, how shall i go about doing it? Need this help urgently. Thanx
-
Hi I know embedded Visual C++ compiler do not accept return statements in this __try and __finally. but i need to return different conditions(values) at different parts of the __try / __finally block, how shall i go about doing it? Need this help urgently. Thanx
You should use the C++ RTTI. These old SEH is residual waste from a time when there was no support for RTTI in the VC++ compiler.
Who is 'General Failure'? And why is he reading my harddisk?!?
-
You should use the C++ RTTI. These old SEH is residual waste from a time when there was no support for RTTI in the VC++ compiler.
Who is 'General Failure'? And why is he reading my harddisk?!?
Structured exception handling and and C++ exception handling are two totally different things and are solutions to two different problems. RTTI is something else all together. In a C++ program try/catch is the way to go unless you are trying to catch OS exceptions such as access violations. For those cases you can use __try or use one of the many wrappers that will convert an SE to a C++ exception. Tim Smith I'm going to patent thought. I have yet to see any prior art.
-
Structured exception handling and and C++ exception handling are two totally different things and are solutions to two different problems. RTTI is something else all together. In a C++ program try/catch is the way to go unless you are trying to catch OS exceptions such as access violations. For those cases you can use __try or use one of the many wrappers that will convert an SE to a C++ exception. Tim Smith I'm going to patent thought. I have yet to see any prior art.
Yes, my fault. RTTI has nothing to do with exceptions. It is switched on the same page of the VC6 configuration dialogues, though. :-) What you said and I meant is written in MSDN as follows:
For C++ programs, it is recommended that you use the new C++ exception-handling mechanism
(try, catch, and throw statements).
Who is 'General Failure'? And why is he reading my harddisk?!?
-
You should use the C++ RTTI. These old SEH is residual waste from a time when there was no support for RTTI in the VC++ compiler.
Who is 'General Failure'? And why is he reading my harddisk?!?
Sorry, just to add in, i am using on embedded Visual C++, so that is why only __try and __except and __finally i can use.unless is using version 4, then i can use try and catch.. but that will have to recompile for a new window CE OS. i can do without __finally, then i can use return statement; but since __finally is a cleanup code, so i thought can use...make the codes cleaner also. so any suggestions? what is RTTI actually?
-
Sorry, just to add in, i am using on embedded Visual C++, so that is why only __try and __except and __finally i can use.unless is using version 4, then i can use try and catch.. but that will have to recompile for a new window CE OS. i can do without __finally, then i can use return statement; but since __finally is a cleanup code, so i thought can use...make the codes cleaner also. so any suggestions? what is RTTI actually?
IceBerG71 wrote: what is RTTI actually? Run Time Type Information. It is the standard conformant way of determining a type at runtime. The same is done in MFC with things like
IsKindOf()
, but with this approach all objects need to have the same base class (CObject
).
Who is 'General Failure'? And why is he reading my harddisk?!?