473,587 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception handling

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.
Nov 14 '05 #1
6 1642

<vk********@hot mail.com> wrote

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.
Nov 14 '05 #2
<vk********@hot mail.com> wrote in message
news:75******** *************** ***@posting.goo gle.com...
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!
Nov 14 '05 #3
On Sat, 18 Sep 2004 19:15:19 +0800, "Liang Chen"
<mi********@hot mail.com> wrote in comp.lang.c:
<vk********@hot mail.com> wrote in message
news:75******** *************** ***@posting.goo gle.com...
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!


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?

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #4
>
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.
Nov 14 '05 #5
"Liang Chen" <mi********@hot mail.com> wrote in message news:<ci******* ****@mail.cn99. com>...

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.

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?
Nov 14 '05 #6
vk********@hotm ail.com wrote:
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
Nov 14 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
2857
by: adi | last post by:
Dear all, This is more like a theoretical or conceptual question: which is better, using exception or return code for a .NET component? I had created a COM object (using VB6), which uses return code (not generating error/exception) so it is more compatible with other programming language.
6
2330
by: Daniel Wilson | last post by:
I am having exception-handling and stability problems with .NET. I will have a block of managed code inside try...catch and will still get a generic ..NET exception box that will tell me which assemblies are loaded before shutting down. In one case, some of my DB-accessing code didn't handle a NULL value properly. But try...catch wouldn't...
7
5980
by: Noor | last post by:
please tell the technique of centralize exception handling without try catch blocks in c#.
3
2742
by: Master of C++ | last post by:
Hi, I am an absolute newbie to Exception Handling, and I am trying to retrofit exception handling to a LOT of C++ code that I've written earlier. I am just looking for a bare-bones, low-tech exception handling mechanism which will allow me to pass character information about an error and its location from lower-level classes. Can you...
2
2588
by: tom | last post by:
Hi, I am developing a WinForm application and I am looking for a guide on where to place Exception Handling. My application is designed into three tiers UI, Business Objects, and Data Access Layer. My questions is where should I put exception handling: 1) Should it be put in all significant methods in all layers? 2) Should I create an...
9
2530
by: C# Learner | last post by:
Some time ago, I remember reading a discussion about the strengths and weaknesses of exception handling. One of the weaknesses that was put forward was that exception handling is inefficient (in the way of CPU usage), compared to the "normal" practise returning values. How true is this? Will using using exception handling, in general, be...
44
4198
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level user tasks should always be included in a try/catch block that actually handles any exceptions that occur (log the exception, display a message box,...
4
5121
by: Ele | last post by:
When Exception handling disabled compiler still spits out "C++ exception handler used." Why is that? Why does it ask for "Specify /EHsc"? Thanks! c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xstring(1453) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
41
3039
by: Zytan | last post by:
Ok something simple like int.Parse(string) can throw these exceptions: ArgumentNullException, FormatException, OverflowException I don't want my program to just crash on an exception, so I must handle all of them. I don't care about which one happened, except to write out exception.Message to a log file. It seems verbose to write out...
1
3096
by: George2 | last post by:
Hello everyone, Such code segment is used to check whether function call or exception- handling mechanism runs out of memory first (written by Bjarne), void perverted() { try{
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8347
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.