Board index » delphi » Problem deriving a component from TIBQuery using BCB6

Problem deriving a component from TIBQuery using BCB6

When I create a component by deriving from TIBQuery, and drop it into a data
module, I get an abnormal termination of BCB6 when attempting to save the
data module. My original component contained many properties and methods and
in order to determine what may be causing the problem I started out by
reducing the component to just a constructor and do-nothing destructor. I
still get the abnormal termination. I do not have the problem creating
components by deriving from TIBSQL, TIBDataSet, or TIBTable.

Is there a bug or known problem in the latest IBX 6.05 for BCB6 regarding
deriving from TIBQuery which someone knows about ? Dropping a TIBQuery on
the same data module does not exhibit this problem.

 

Re:Problem deriving a component from TIBQuery using BCB6


Quote
"Edward Diener" <eddie...@tropicsoft.com> wrote in message

news:3e5bd8a0$1@newsgroups.borland.com...

Quote
> When I create a component by deriving from TIBQuery, and drop it into a
data
> module, I get an abnormal termination of BCB6 when attempting to save the
> data module. My original component contained many properties and methods
and
> in order to determine what may be causing the problem I started out by
> reducing the component to just a constructor and do-nothing destructor. I
> still get the abnormal termination. I do not have the problem creating
> components by deriving from TIBSQL, TIBDataSet, or TIBTable.

Be sure you're calling inherited Create and inherited Destroy.

--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
"Democracy, without that guarantee of liberty, is merely a method of
selecting tyrants." - Alan Nitikman

Re:Problem deriving a component from TIBQuery using BCB6


Quote
Wayne Niddery [TeamB] wrote:
> "Edward Diener" <eddie...@tropicsoft.com> wrote in message
> news:3e5bd8a0$1@newsgroups.borland.com...
>> When I create a component by deriving from TIBQuery, and drop it
>> into a data module, I get an abnormal termination of BCB6 when
>> attempting to save the data module. My original component contained
>> many properties and methods and in order to determine what may be
>> causing the problem I started out by reducing the component to just
>> a constructor and do-nothing destructor. I still get the abnormal
>> termination. I do not have the problem creating components by
>> deriving from TIBSQL, TIBDataSet, or TIBTable.

> Be sure you're calling inherited Create and inherited Destroy.

It's C++ Wayne, not OP. I must call TIBQuery's constructor passing it the
TComponent pointer that is passed to me in my own constructor, since there
is no default constructor, else I receive a compiler error. Of course I am
doing that. Also the destructor gets automagically called in C++ from within
one's own destructor. So that's not the problem.

I will work on demonstrating my case by creating a simple package with C++
Builder 6 with a single TIBQuery derived component which does nothing. Then
I will create a do-nothing GUI app on whose form the component can be
dropped. If this causes the problem I am getting, I will post the whole
thing on QC and/or notify Mr. Overcash if he is notifiable about it.

Currently my single TIBQuery-based component which does nothing is part of a
larger package of components and when I drop this component on a data module
of an application there are many other components already on the data
module, so maybe some combination of these things is causing my problem.
However I know it is coming from my do-nothing TIBQuery-based component
since when I do not drop that component on my data module everything else
works fine.

Re:Problem deriving a component from TIBQuery using BCB6


This is a compiler bug and I can do nothing about it.  Either a) write it in OP,
or b) aggregate it in another component.

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
If there is somebody up there could they throw me down a line.  Just a
little helping hand just a little understanding.  Just some answers to the
questions that surround me now.  If there's somebody up there could
they throw me down a line.               (Fish)

Re:Problem deriving a component from TIBQuery using BCB6


Would you please tell me what the compiler bug is and where it is occurring
? I could then report the compiler bug to Borland with an illustration of
its error.

I see no comment on my QC report nor am I doing anything other than derive a
component from TIBQuery with no other code. I can also derive a component
from TIBDataSet, TIBSQL, and TIBTable successfully with no problem so I
would like to know what compiler bug is producing the problem of deriving
from TIBQuery. I assume by compiler bug you mean that the compiler is
producing incorrect code since the compiling/linking step works with no
errors in order to produce the component.

Quote
Jeff Overcash (TeamB) wrote:
> This is a compiler bug and I can do nothing about it.  Either a)
> write it in OP, or b) aggregate it in another component.

Re:Problem deriving a component from TIBQuery using BCB6


Quote
"Edward Diener" <eddie...@tropicsoft.com> wrote:
>Would you please tell me what the compiler bug is and where it is occurring
>? I could then report the compiler bug to Borland with an illustration of
>its error.

>I see no comment on my QC report nor am I doing anything other than derive a
>component from TIBQuery with no other code. I can also derive a component
>from TIBDataSet, TIBSQL, and TIBTable successfully with no problem so I
>would like to know what compiler bug is producing the problem of deriving
>from TIBQuery. I assume by compiler bug you mean that the compiler is
>producing incorrect code since the compiling/linking step works with no
>errors in order to produce the component.

Yes it is messing up the VTable links so everything is fine
until an actual call is made.  I did not have time this weekend
to go further into it than that.  I don't anticipate having the
time to go deeper into this in the next few weeks.  This bug
has been around for at least 2 years and has been reported by
one other person so is considered an extreme corner case.

Since Borland is rebuilding the C++ compiler pretty much from
scratch it is unlikely they will go and open up the old
compiler for a corner case like this.  Like I suggested either
aggegate it or write in in OP (which is the best if you want to
make it available to others since Delphi wouldn't be able to
use a C++ component any ways).

Quote
>Jeff Overcash (TeamB) wrote:
>> This is a compiler bug and I can do nothing about it.  Either a)
>> write it in OP, or b) aggregate it in another component.

Re:Problem deriving a component from TIBQuery using BCB6


Quote
Jeff Overcash (TeamB) wrote:
> "Edward Diener" <eddie...@tropicsoft.com> wrote:
>> Would you please tell me what the compiler bug is and where it is
>> occurring ? I could then report the compiler bug to Borland with an
>> illustration of its error.

>> I see no comment on my QC report nor am I doing anything other than
>> derive a component from TIBQuery with no other code. I can also
>> derive a component from TIBDataSet, TIBSQL, and TIBTable
>> successfully with no problem so I would like to know what compiler
>> bug is producing the problem of deriving

>> from TIBQuery. I assume by compiler bug you mean that the compiler is
>> producing incorrect code since the compiling/linking step works with
>> no errors in order to produce the component.

> Yes it is messing up the VTable links so everything is fine
> until an actual call is made.  I did not have time this weekend
> to go further into it than that.  I don't anticipate having the
> time to go deeper into this in the next few weeks.  This bug
> has been around for at least 2 years and has been reported by
> one other person so is considered an extreme corner case.

Where is this bug documented ? On QC, in a TI, in a FAQ, on Borland's web
site ?

In what situations does this bug occur ? It is important to know this in
order to avoid the bug situation and not waste time attempting to create or
derive a class in which this bug will result.

Why does this bug occur in TIBQuery derivation and not in TIBDataSet,
TIBTable, or TIBSQL derivation ? Does this bug occur when deriving from any
other VCL component, whether IB or otherwise ?

I would think that a bug which has been around for a couple of years and
could manifest itself in the use of Borland's own libraries, such as the
VCL, would have been prioritized to be fixed some time ago and not be
allowed to sit around until it bit a programmer such as me using one of
those libraries. By "use" I of course mean either instantiating an object of
a class or deriving a new class from an existing class.

Quote

> Since Borland is rebuilding the C++ compiler pretty much from
> scratch it is unlikely they will go and open up the old
> compiler for a corner case like this.  Like I suggested either
> aggegate it or write in in OP (which is the best if you want to
> make it available to others since Delphi wouldn't be able to
> use a C++ component any ways).

I am a C++ programmer and do not use OP.

I appreciate your suggestion of aggregation, as kludgy as this solution
normally is. I will try deriving my class from TComponent, repeating all of
the TIBQuery properties, methods, and events in my own class, instantiating
a TIBQuery object in my own class and handling all its events, and then
passing the appropriate properties, methods, and event handling between the
end-user and my instantiated TIBQuery object. Hopefully I can succeed this
way. If you know of any other better aggregate techniques to achieve this,
please feel free to suggest them. If this doesn't work properly for whatever
reason, and Borland can not fix their compiler bug in the meanwhile to fix
the current problem, then I am just personally out of alternatives and luck.

Other Threads