Exception handling

V

vkreddy_in

HI
Currently i am handling excpetion using TRY/catch in my code.I am
looking for solution some thing like this.

if an excrption is occured then
1.call a CALLBACK function in a DLL
2.print the log message return from function call but excute the next
instruction in the current function(when i return i want to go to the
next instruction,not the instruction that was raised an exception)


i know want to know using structured excpetion handling and some
assembly language instructions can we do this?.

can some body help

thank u very much

Reddy.
 
M

Malcolm

Currently i am handling excpetion using TRY/catch in my code.I am
looking for solution some thing like this.
So you've got the wrong group. comp.lang.c++ is round the corner.
 
L

Liang Chen

HI
Currently i am handling excpetion using TRY/catch in my code.I am
looking for solution some thing like this.

if an excrption is occured then
1.call a CALLBACK function in a DLL
2.print the log message return from function call but excute the next
instruction in the current function(when i return i want to go to the
next instruction,not the instruction that was raised an exception)


i know want to know using structured excpetion handling and some
assembly language instructions can we do this?.

can some body help

thank u very much

Reddy.

You can use setjmp/longjmp to set up your own exception handling facility.
It also exists a project of exception handling, which named CException. You
can find it on www.sourceforge.net. Remember to read the comments in the
head file before you use it. Good Luck!
 
J

Jack Klein

You can use setjmp/longjmp to set up your own exception handling facility.
It also exists a project of exception handling, which named CException. You
can find it on www.sourceforge.net. Remember to read the comments in the
head file before you use it. Good Luck!

And where in the definition of setjmp/longjmp does the C standard
define a way to resume the function that caused the exception at the
machine language instruction right after the one that generated the
exception?
 
L

Liang Chen

And where in the definition of setjmp/longjmp does the C standard
define a way to resume the function that caused the exception at the
machine language instruction right after the one that generated the
exception?

Of course, it is NOT a real exception, but a way for you to handle the
customized exception.
 
V

vkreddy_in

Liang Chen said:
Of course, it is NOT a real exception, but a way for you to handle the
customized exception.


Thank you very much for your help,can you please tell me a way to
resume the function that caused the exception at the machine language
instruction right after the one that generated?
 
R

Richard Bos

Thank you very much for your help,can you please tell me a way to
resume the function that caused the exception at the machine language
instruction right after the one that generated?

That's not possible without resorting to highly architecture-specific,
and possibly quite arcane, techniques. Ask in a newsgroup which
discusses your OS, compiler and hardware; do not expect the answer to
port to anything else. It certainly cannot be done in portable C.

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
EmeliaBryc

Latest Threads

Top