1

Topic: C ++ Builder XE5. TADOConnection. try catch. Does not work.

Hello, colleagues!
I write dll on Embarcadero a C ++ Builder XE5.
For connection with a DB on MS a SQL Server I use component TADOConnection.
//======
try {SQLConnection-> Connected = true;}
catch (...)
{
//exception handling
};
//======
All works remarkably until the server does not appear is inaccessible for any of several reasons.
The matter is that the normal method of catching of exceptions (try catch) does not work if to start application not from under IDE, and the program under abnormal condition completes operation.
There is a suspicion that it, generally, bug XE5.
If someone faced this or similar problem and solved it, I ask to prompt.

2

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

andrandrk;
And than differs try from __ try remember?

3

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

. __ try it is used with __ except and __ finally. It not c ++ a construction, on how many I understand, and an environment superstructure.
__ try __ except too, by the way, tried for catching of this exception. The same effect.

4

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

andrandrk wrote:

Navskidku. __ try it is used with __ except and __ finally. It not c ++ a construction, on how many I understand, and an environment superstructure.
__ try __ except too, by the way, tried for catching of this exception. The same effect.

And what AXIS? On Win XP there were with any exceptions similar problems
Try  exceptions, catches for example?:
Language exception
Division into a zero

5

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

wrote:

and what AXIS?

Windows 7.
try {1/0;}
catch (...)
{
//exception handling
};
It is caught remarkably.

6

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

andrandrk wrote:

I Write dll on Embarcadero a C ++ Builder XE5.
try {}
catch (...)
{
//exception handling
};
//======
All works remarkably until the server does not appear is inaccessible for any of several reasons.
The matter is that the normal method of catching of exceptions (try catch) does not work if to start application not from under IDE, and the program under abnormal condition completes operation.
There is a suspicion that it, generally, bug XE5.
If someone faced this or similar problem and solved it, I ask to prompt.

Speech about 32 bit or 64 bit variant?

7

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

wrote:

Speech about 32 bit or 64 bit variant?

64

8

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

andrandrk;
In the documentation an example such

try
{
ADOConn-> Connected = true;
}
catch (EADOError *e)
{
MessageDlg ("Error while connecting", mtError;
TMsgDlgButtons () <<mbOK, 0);
return;
}

9

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

d7i;
The documentation .  on it my code (the topic question see) also is written - from your example differs only instructions of a class of an exception. So too does not work. Tried.

10

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

Forgot to add. Copy TADOConnection I create dynamic. That is there is no form, there is no component on the form.
//In a heading file:
class TMyClass {
//...
private:
TADOConnection* SQLConnection;
};
//...
//In designer TMyClass:
//...
try {SQLConnection = new TADOConnection (0);}
catch (...)
{
//handling
};
//...
try {SQLConnection-> Connected = true;}
catch (...)
{
//handling (the exception is not caught, a topic question)
};
//...

11

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

andrandrk;
On 7-ke like all norms was
Casually, not in a flow do it?

12

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

kealon (Ruslan);

wrote:

it is casual, not in a flow do it?

1. It is almost assured that in the core (and the only thing) a flow all happens. We tell so, in DLL additional flows I do not create, and the calling application not my authorship, but there, most likely, too additional flows are not present. And if not in the main flow me cause, what it changes?
2. At the assembly on MS VC the considered exception is remarkably caught. Here matter is not in OS.

13

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

andrandrk wrote:

kealon (Ruslan);
it is passed...
1. It is almost assured that in the core (and the only thing) a flow all happens. We tell so, in DLL additional flows I do not create, and the calling application not my authorship, but there, most likely, too additional flows are not present. And if not in the main flow me cause, what it changes?
2. At the assembly on MS VC the considered exception is remarkably caught . Here matter is not in OS.

With rantajm-biblami collected most likely, so?
Flows yes, most likely there is nothing then

14

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

That there in this Bildere - one  already only knows.
You should repeat a feat of Orfeja...

15

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

wrote:

with rantajm-biblami collected most likely, so?

Collected with the removed flag "Build with runtime packages". Decided to cock a flag and . The error was caught.
Considering this input, it is possible to make something?

16

Re: C ++ Builder XE5. TADOConnection. try catch. Does not work.

andrandrk wrote:

it is passed...
Collected with the removed flag "Build with runtime packages". Decided to cock a flag and . The error was caught.
Considering this input, it is possible to make something?

Objects of exceptions in different libraries form and accordingly causing does not know that for  palmed off on it and cannot catch
Kitchen all show as you cause and where there is a call, normally such affairs by return codes become or SafeCall it is possible to use for simplification