Board index » cppbuilder » ValueListEditor - catch Exception

ValueListEditor - catch Exception


2008-03-07 01:15:09 AM
cppbuilder33
Hello,
I use a ValueListEditor and I want to catch the ValueListEditors
Exceptions. But where belongs the try block? The valEdit is on an modal
form. A try-catch to ShowModal does not work...
I study the source valedit.pas and find no way to suppress the
exception. The Application->OnException works, but there I have my
central error reporting and the code is far away. OnException handler is
in the main.exe, the ValueListEditor is in an load-time-dll (via
LoadLibrary/GetProcAddr).
Any suggestion?
Best regards,
Martin
 
 

Re:ValueListEditor - catch Exception

"Martin" < XXXX@XXXXX.COM >wrote in message
Quote
I use a ValueListEditor and I want to catch the ValueListEditors
Exceptions. But where belongs the try block?
That depends on what you are trying to catch exactly. Please provide more
details.
Quote
I study the source valedit.pas and find no way to suppress the exception.
Which exception are you referring to exactly?
Gambit
 

Re:ValueListEditor - catch Exception

Hello Gambit,
I want catch the Exception SNoEqualsInKey and SKeyConflict, raised in
valedit.pas line 960 or so. The reason is: the excption view a
messagebox and the user must click this away. I want now show the
exception in a inconspicuous kind like a Label or so.
Martin
Remy Lebeau (TeamB) schrieb:
Quote
>...
>I use a ValueListEditor and I want to catch the ValueListEditors
>Exceptions. But where belongs the try block?

That depends on what you are trying to catch exactly. Please provide more
details.

>I study the source valedit.pas and find no way to suppress the exception.

Which exception are you referring to exactly?


Gambit
 

{smallsort}

Re:ValueListEditor - catch Exception

"Martin" < XXXX@XXXXX.COM >wrote in message
Quote
I want catch the Exception SNoEqualsInKey and
SKeyConflict, raised in valedit.pas line 960 or so.
There are only two times when either of those exceptions can be raised:
1) the user is editing a key name visually and types in a '=' character.
The only way to catch the exceptions in this scenerio is the
TApplication.OnException event.
2) you are inserting/updating strings in the editor in your code. You can
wrap your code directly in a try..catch.
Gambit