SEARCH YOUR SOLUTION HERE  

vc6 exception not getting caught in vs2k5



My application has a small JNI piece written in C++. This piece was
developed using VC++ 2k5. We statically link with some .lib's which
were built using vc6. I see that exceptions thrown by some api's in
these .lib's are not getting caught but are causing the app to crash.
When this code was "ported" to vc6 this wasn't observed. It so happens
we also support HPUX n Solaris n it works fine there too. Why's this
happening

Posted On: Monday 5th of November 2012 12:52:00 AM Total Views:  298
View Complete with Replies




Related Messages:

C++0x/1x exception specifications proposal: Compile-time checked   (163 Views)
Perhaps a mechanism can be introduced in the C++0x/1x standard, something simple like defining a function as: void somefunc(void) throw() { // ... } and getting a compile time error saying something like: "Error: void somefunc(void) throw(): Wrong exception specification. somefunc can throw std::bad_alloc, std::range_error". That is make the compiler to check exception specifications for errors too. Ioannis A. Vranos -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
Is exception specification available?   (128 Views)
#include #include using namespace std; class c1 { public: c1() { c1str = "error 1"; } string c1str; }; class c2 { public: c2() { c2str = "error 2"; } string c2str; }; void fn() throw (c1,bad_exception) { cout
Strong exception safety guaranty - Did I forget something ?   (232 Views)
Alf P. Steinbach a crit : > The above operator= should work nicely, but is too complicated for my > taste. > > I'd just use the usual swap idiom,
Missing exception throwing   (156 Views)
I've a question which deals with the interaction between a C++ application and the underlying OS. So, it's not pure C++ but I hope that you still can help me: I've two 32bit Debian Etch machines which show a different behavior for the execution of the same C++ application. The C++ is just a test program running a loop which dynamically allocates some objects on the heap and than run an external application via "system". On the one machine after allocating 2^31 Bytes RAM (I think this will be the maximally permitted memory usage of a single process), the process terminates by throwing an exception: machine terminate called after throwing an instance of 'std::bad_alloc' what(): St9bad_alloc This is what I would expect. On the other Debian box, in contrast, no exception is thrown! After running out of memory, the "system" call fails (return value == -1). Do you see any reasons why throwing std::bad_alloc was omitted Can a C++ program be somehow configured to omit throwing this exception Thank you.
The company always pays attention to the quality of its undergarmentsso that they conform to international standards. All these stuffs are madefrom materials of exceptionally softest fabrics. The Button Fly Boxer Brief,Pro Stretch Boxer Brief, 365 Fa   (320 Views)
The company always pays attention to the quality of its undergarments so that they conform to international standards. these stuffs are made from materials of exceptionally softest fabrics. The Button Fly Boxer Brief, Pro Stretch Boxer Brief, 365 Fashion Trunk and 365 Color Trunk are some of its offing that gives you a distinct identity. At the same time, it wont create a heavy financial burden on you, because at 1underwearstore.com, availing these popular stuffs is unbelievably cheap. http://www.replicab2b.net http://www.replicab2b.net/Replica_Wallets_1.html http://www.replicab2b.net/Replica_Jewelrys_1.html http://www.replicab2b.net/Replica_Shoes_1.html http://www.replicab2b.net/Replica_Jeans_1.html http://www.replicab2b.net/Replica_Sunglasses_1.html http://www.replicab2b.net/Replica_Clothing_1.html
Throwing exceptions   (210 Views)
pleatofthepants wrote: > I am supposed to throw some exceptions in myVector class but when I > impliment them I get an error saying > > myVector.h:139: error: looser throw specifier for `myVector& > myVector:opFront(T&) [with T = int]' > myVector.h:17: error: overriding `containerInterface& > containerInterface:opFront(T&) throw (BADINDEX) [with T = int]' > > What is wrong with the way that I am throwing my exceptions in my > functions in the myVector class I think it's because the base class does have exception specifications on a bunch of functions and the derived class doesn't. > here is the .h > > #ifndef _MYVECTOR > #define _MYVECTOR > > using namespace std; > > > > class BADINDEX {}; > > template > class containerInterface > { > public: > > [..] > virtual containerInterface & popFront(T&) throw (BADINDEX) = 0; ^^^^^^^^ !!!!! > [..] > }; > > template > class myVector: public containerInterface > { > [..] > myVector & popFront (T& n) ^^^^^ > { > if(isEmpty()) > { > throw (BADINDEX()); > } > n = data[0]; > shiftLeft(); > > > return *this; > } > [..] > }; > > > > #endif V -- Please remove capital 'A's when replying by e-mail I do not respond to top-posted replies, please don't ask
exception objects to be destroyed twice   (124 Views)
In David Abrahams article http://accu.org/index.php/journals/332 , it says : "Unfortunately, several popular compilers occasionally cause exception objects to be destroyed twice." So, I want to know why destroy twice and which compilers do like this -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
map throwing unhandled exception   (187 Views)
Hi does anyone know the answer to this one. If I use the following code on the same page as the main{ } function then it works ok. If I use it on an external page like a header page for a class it throws an unhandled exception when the program is closed,driving me nutsssss typedef map CatNSubs;//to hold the category list and CatNSubs subTable;//for catagory and subs typedef CatNSubs::const_iterator mapIter; typedef map::const_iterator innerMapIter; as I said this works perfectly on the main page. regards LB
MinGW not so good with exceptions?   (166 Views)
all, I'm using MinGW as part of my toolchain in Eclipse, and I am trying to figure out why I am getting a compiler error when I include the header. The command that eclipse is running is g++ -IC:\Dave\School\common\cxx -IC:\Dave\School\common\third party \packages\glut-3.7.6-bin\include -IC:\Dave\School\common\third party \packages\pthreads-2005-03-08\Pre-built\include -O0 -g3 -Wall -c - fmessage-length=0 -ogllib\test_gllib.o ..\gllib\test_gllib.cpp The error I get is: In file included from C:/Dave/School/common/cxx/math/math_utils.h:13, from C:/Dave/School/common/cxx/gfx2d/color.h:9, from C:/Dave/School/common/cxx/gllib/gl_light.h: 6, from ..\gllib\test_gllib.cpp:8:C:/mingw/bin/../lib/ gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/limits:290: error: expected `;' before "throw" C:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/ limits:292: error: expected `;' before "static" C:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/ limits:292:22: macro "max" requires 2 arguments, but only 1 given If I go and look at that code in MinGW's "limits" file, I see the following struct, in which the the static min() function is the first offending line of code: template struct numeric_limits : public __numeric_limits_base { /** The minimum finite value, or for floating types with denormalization, the minimum positive normalized value. */ static _Tp min() throw() { return static_cast(0); } /** The maximum finite value. */ static _Tp max() throw() { return static_cast(0); } /** The @e machine @e epsilon: the difference between 1 and the least value greater than 1 that is representable. */ static _Tp epsilon() throw() { return static_cast(0); } /** The maximum rounding error measurement (see LIA-1). */ static _Tp round_error() throw() { return static_cast(0); } /** The representation of positive infinity, if @c has_infinity. */ static _Tp infinity() throw() { return static_cast(0); } /** The representation of a quiet "Not a Number," if @c has_quiet_NaN. */ static _Tp quiet_NaN() throw() { return static_cast(0); } /** The representation of a signaling "Not a Number," if @c has_signaling_NaN. */ static _Tp signaling_NaN() throw() { return static_cast(0); } /** The minimum positive denormalized value. For types where @c has_denorm is false, this is the minimum positive normalized value. */ static _Tp denorm_min() throw() { return static_cast(0); } }; I've never actually seen that throw() syntax before, as I've always just had throw statements in the body of my code. At any rate, I thought that GCC might be trying to compile without exceptions, so I tried including the -fexceptions option to GCC, but that made no difference. So, any ideas what might get it going
uncaught_exception vs. threads   (195 Views)
In the current standard std::uncaught_exception indicates if there is at least one uncaught exception in the program. What is it going to indicate in multi-threaded c++0x at least one uncaught exception in the program or in the the thread that it is called from Anyway, can you safely throw in one thread if we unwind the stack in the other &rzej --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
What happens when an exception is not caught?   (116 Views)
Sorry for the rudimentary question. I found the following posting online and did not know the answer myself. "Reminds me of a time I had a phone interview concerning a C++ job. Didn't help that the interviewer had a very thick Slavic accent. He asked me what happens when an exception doesn't get caught. I told him the program would terminate. He said that's not the answer he was looking for. I gave him a kind of detailed description of the throw process leading to "then it gets to the top level of the program and if there is no exception handling there, the program terminates." He said "no, what I was looking for is that the unhandledExceptionHandler is called" (might not have the correct name.)" Is there a default exception handler
list of exceptions thrown from std::string class   (185 Views)
Hi C++ Experts, Where can I find a list of exceptions thrown form std::string class and at what scenario
Bjarne's comments about exception specification   (154 Views)
, How do you understand the Bjarne's comments about exception specification Especially, "not required to be checked across compilation-unit" and "violations will not be caught at run time" section 14.6.1 Checking Exception Specifications -------------------- Importantly, exception-specifications are not required to be checked exactly across compilation-unit boundaries. Naturally, an implementation could check. However, for many large and long-lived systems, it is important that the implementation does not -- or, if it does, than it carefully gives hard errors only where violations will not be caught at run time. --------------------
exception class hierarchy   (191 Views)
If I have the ff classes class A : public std::exception { }; class B : public A { }; class C : public A { }; class D: public B { } In what order do I need to 'catch' thrown exceptions (particular emphasis on classes B and C which have the same hierarchy
STL sort throw exception?   (194 Views)
, In Bjarne's book, it is mentioned that sort of STL may throw exception, like sorting elements in a vector. In what situation will sort throw exception I can not find a case.
Re: Throwing exceptions in destructors?   (172 Views)
On 30 Lis, 19:42, Carlos Moreno wrote: > For the time being, I'm simply not throwing an exception, > with the unfortunate side-effect that the error is simply > being silently ignored. I'd like to do better than that. In this (simple) case I would not bother with uncaught_exception[*] trick, but rather set an error flag (or otherwise leave some mark that the operation failed) that can be later tested. The code that explicitly tests the flag can safely translate it into an exception, if this is expected. In your case, however, since the error will be handled at the very end of the program, throwing might not make sense, because at the very end of the program there is no benefit from decoupling problem discovery from problem handling. [*] Note that uncaught_exception can inform you that you are *now* in the process of stack unwinding that was triggered by some already flying exception. You might think that this can help you decide whether it is safe to throw an exception or not. The problem is that the only alternative to throwing is not throwing and since you don't want to silently ignore the error, you would end up setting some error flag anyway. That's why I would do it systematically and (suprise) gain uniform way of handling errors from this single place. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
out_of_range exception and subscript operator   (136 Views)
For vector and deque, the 'at( )' member function throws out_of_range exception if the argument to the 'at( )' function is not in range. But the subscript operator [ ] does not throw this exception for the same situation. My question: Why can't the subscript operator [ ] itself throw the out_of_range exception in which case the 'at ( )' member function may not be needed Kindly explain
Which exception it is?   (125 Views)
Hi! When call a null function pointer will cause a execption, but it can't be caught as std::exception, then which exception it is The following code is a example: typedef void (*testfunc)(int a); void test() { testfunc func = NULL; func(10); iTest* p = NULL; p->Test(10); } int main() { try { test(); } catch(std::exception& x) { std::cout
Do exception classes still need no-fail copy constructors, in C++0x?   (218 Views)
In article , noreply@this.is.invalid (Niels Dekker - no return address) wrote: > When writing a custom exception class in C++03, it's recommended to have > its copy constructor supporting the no-fail guarantee, to prevent the > exception handling mechanism from calling std::terminate(). [E.g., Herb > Sutter & Andrei Alexandrescu - C++ Coding Standards, item 32] Is that > recommendation still relevant in C++0x I got the impressing that in > C++0x, it's good enough to just make sure that the exception class has a > non-failing move constructor. > > Should an STL implementation still take care of proving non-failing copy > constructors for exception classes like std::runtime_error, in C++0x > Or would it be sufficient to provide non-failing move constructors for > these classes The following program in conceptgcc: #include class A { A(const A&); A& operator=(const A&); public: A() {} A(A&&) {} }; void f() { A a; throw a; } int main() { try { f(); } catch (A&) { std::cout
exceptions   (159 Views)
If you have code like: try { c = 0; // initialize c = new C(...); // c of type C* } catch( E& e) { ... } and an exception is thrown inside the constructor. Is it guaranteed that c will be null