Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Exceptions in C/C++

Reply
Thread Tools

Exceptions in C/C++

 
 
opexoc@gmail.com
Guest
Posts: n/a
 
      12-07-2007
Hello,

I have question concerning such code:

__try
{
...
} __except(EXCEPTION_EXECUTE_HANDLER)
{
printf("Exception code: %.8x\n", GetExceptionCode());
}


Is C related code? Or maybe C++?

opexoc
 
Reply With Quote
 
 
 
 
Tor Rustad
Guest
Posts: n/a
 
      12-07-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Hello,
>
> I have question concerning such code:
>
> __try
> {
> ...
> } __except(EXCEPTION_EXECUTE_HANDLER)
> {
> printf("Exception code: %.8x\n", GetExceptionCode());
> }
>
>
> Is C related code? Or maybe C++?


It's not ISO C, but Microsoft specific C, see their MSDN doc.

--
Tor <(E-Mail Removed) | tr i-za-h a-z>
 
Reply With Quote
 
 
 
 
opexoc@gmail.com
Guest
Posts: n/a
 
      12-07-2007
So if I want to use exceptions catching in dev-cpp in C code then what
should I do?

On 7 Gru, 01:58, Tor Rustad <(E-Mail Removed)> wrote:
>
> It's not ISO C, but Microsoft specific C, see their MSDN doc.



 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      12-07-2007
(E-Mail Removed) wrote:
> So if I want to use exceptions catching in dev-cpp in C code then what
> should I do?
>
> On 7 Gru, 01:58, Tor Rustad <(E-Mail Removed)> wrote:
>> It's not ISO C, but Microsoft specific C, see their MSDN doc.

>
>


If you use the lcc-win compiler you can use the
__try/__except construct.

URL below

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
 
Reply With Quote
 
opexoc@gmail.com
Guest
Posts: n/a
 
      12-07-2007
On 7 Gru, 14:59, jacob navia <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > So if I want to use exceptions catching in dev-cpp in C code then what
> > should I do?

>
> > On 7 Gru, 01:58, Tor Rustad <(E-Mail Removed)> wrote:
> >> It's not ISO C, but Microsoft specific C, see their MSDN doc.

>
> If you use the lcc-win compiler you can use the
> __try/__except construct.


Ok but dec-cpp has any construct which is to catching exception for C
language?



 
Reply With Quote
 
Francine.Neary@googlemail.com
Guest
Posts: n/a
 
      12-07-2007
On Dec 7, 1:59 pm, jacob navia <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > So if I want to use exceptions catching in dev-cpp in C code then what
> > should I do?

>
> > On 7 Gru, 01:58, Tor Rustad <(E-Mail Removed)> wrote:
> >> It's not ISO C, but Microsoft specific C, see their MSDN doc.

>
> If you use the lcc-win compiler you can use the
> __try/__except construct.
>
> URL below


Rather than using extensions that tie your code to a particular
compiler and platform, why not use the perfectly good exception-
handling features already present in standard C, namely setjmp()/
longjmp()?

>
> --
> jacob navia
> jacob at jacob point remcomp point fr
> logiciels/informatiquehttp://www.cs.virginia.edu/~lcc-win32


 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      12-07-2007
(E-Mail Removed) wrote:
> On 7 Gru, 14:59, jacob navia <(E-Mail Removed)> wrote:
>> (E-Mail Removed) wrote:
>>> So if I want to use exceptions catching in dev-cpp in C code then what
>>> should I do?
>>> On 7 Gru, 01:58, Tor Rustad <(E-Mail Removed)> wrote:
>>>> It's not ISO C, but Microsoft specific C, see their MSDN doc.

>> If you use the lcc-win compiler you can use the
>> __try/__except construct.

>
> Ok but dec-cpp has any construct which is to catching exception for C
> language?
>
>
>


dev-cpp is an IDE. The compiler used is gcc in its "mingw" incarnation.
As fas as I know there isn't anything like that in gcc.

Therefore is not there for devcpp


--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      12-07-2007
(E-Mail Removed) wrote:
>
> Rather than using extensions that tie your code to a particular
> compiler and platform, why not use the perfectly good exception-
> handling features already present in standard C, namely setjmp()/
> longjmp()?
>


because they do not do what exceptions do.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
 
Reply With Quote
 
dj3vande@csclub.uwaterloo.ca.invalid
Guest
Posts: n/a
 
      12-07-2007
In article <(E-Mail Removed)>,
<(E-Mail Removed)> wrote:

>Rather than using extensions that tie your code to a particular
>compiler and platform, why not use the perfectly good exception-
>handling features already present in standard C, namely setjmp()/
>longjmp()?


setjmp and longjmp are not exactly "perfectly good exception-handling
features"; setjmp is merely a restricted COME FROM, and longjmp marks
acceptable targets for it.

It's possible to build a perfectly good exception-handling system on
top of setjmp/longjmp, but it does have to be built.


dave

 
Reply With Quote
 
Richard Tobin
Guest
Posts: n/a
 
      12-07-2007
In article <fjbo08$hso$(E-Mail Removed)>,
<(E-Mail Removed)> wrote:

>setjmp and longjmp are not exactly "perfectly good exception-handling
>features"; setjmp is merely a restricted COME FROM, and longjmp marks
>acceptable targets for it.


The whole point of COME FROM is that the jumped-from location isn't
marked.

-- Richard
--
:wq
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exceptions - How do you make it work like built-in exceptions? Lie Python 3 01-14-2008 06:45 PM
Exceptions + Performance on path without exceptions gratch06@gmail.com C++ 3 04-16-2007 08:52 PM
Checked exceptions vs unchecked exceptions Ahmed Moustafa Java 5 07-14-2004 01:46 PM
ImageList Errors - Exceptions and...need HELP Herr Lucifer ASP .Net 0 06-21-2004 10:21 AM
Custom exceptions -- inherit from exceptions.Exception? Paul Miller Python 3 11-12-2003 09:24 AM



Advertisments