Boost logo

Boost Users :

Subject: Re: [Boost-users] Exception handling inside a dll
From: Matthew LaCrosse (mlacrosse3_at_[hidden])
Date: 2008-10-04 17:45:16


Java can't catch native code exceptions. The exception has to be caught in
the C++ code but so far traditional exception handling isn't working. I even
tried put a try/catch block around the entire function and it still crashes.

On Sat, Oct 4, 2008 at 6:08 AM, Boris <boriss_at_[hidden]> wrote:

> On Sat, 04 Oct 2008 00:28:10 +0200, Matthew LaCrosse <mlacrosse3_at_[hidden]>
> wrote:
>
> Hello,
>>
>> I'm writing a JNI dll that can be called from a Java GUI. The java program
>> passes a regex and a string to search. The dll function does a
>> boost::regex_search and returns an IntArray with the results. The problem
>> that I'm having is that bad expressions result in a crash. For instance,
>> if
>> the user inputs \b as the regex and 'bad' as the string, the program
>> crashes.
>>
>
> You must catch the exception in your C++ code and convert it to a Java
> exception yourself (I assume you want your Java code to catch the
> exception?).
>
> Boris
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net