Subject Re: [IBO] Re: IBA_Statement.IMP ???
Author Jason Wharton
You really should always have an owner when dynamically creating components
like this.

You are correct that NEW is wrong here. You need to use the object
constructor, not a method that simply allocates a chunk of memory the size
of the object type.

HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "Svein Erling Tysvær" <svein.erling.tysvaer@...>
To: <IBObjects@yahoogroups.com>
Sent: Thursday, February 01, 2001 4:34 AM
Subject: Re: [IBO] Re: IBA_Statement.IMP ???


> Simon,
>
> I think you want something like
> TIB_Connection *Connection;
> Connection = TIB_Connection->Create(NULL);
>
> TIB_Transaction *Trans;
> Trans = TIB_Transaction->Create(Application);
>
> I don't know the correct parameters for TIB_Connection->Create, but I
think
> calling new is wrong.
>
> Set
>
> At 11:17 01.02.2001 -0000, you wrote:
> >Just to make things alittle bit clearer.
> >I want to do this in my program:
> >
> >TIB_Connection *Connection;
> >Connection = new TIB_Connection(NULL);
> >
> >TIB_Transaction *Trans;
> >Trans = new TIB_Transaction(Application);
> >
> >
> >This work throw the compilator. But when I run the program, is the
> >warning message "TIB_Transaction needs a connection to work!", and as
> >I said earlier this is before the objects is being created. And then
> >does it put the cursor on a file (Delphi code) where the warning
> >message is being trown.
> >
> >Simon
> >
> >--- In IBObjects@y..., "Jason Wharton" <jwharton@i...> wrote:
> >> Something seems really funny here. You don't use New() to create
> >these
> >> objects. You use their constructors. As for those files, they are
> >merely
> >> included in the unit IB_Components.pas. Don't put them in any uses
> >clauses.
> >>
> >> HTH,
> >> Jason Wharton
> >> CPS - Mesa AZ
> >> http://www.ibobjects.com
> >>
> >>
> >> ----- Original Message -----
> >> From: <simpor81@h...>
> >> To: <IBObjects@y...>
> >> Sent: Wednesday, January 31, 2001 7:00 AM
> >> Subject: [IBO] IBA_Statement.IMP ???
> >>
> >>
> >> > Hello!
> >> >
> >> > I have a little problems with the TIB_Connection and
> >TIB_Transaction.
> >> > I want to create them with the "new" command during runtime. But
> >> > everytime when I start up the acplication does it say that
> >> > IB_Transaction needs a connection to work. And I haven't even
> >created
> >> > the object yet!
> >> >
> >> > Can't you create these two objects during runtime? If I put the
> >> > component on the form and sets up the connection does it work
> >> > proberly. But I'm not using those components later in code!
> >> >
> >> > And when I run the program does it say that I need the file
> >> > IBA_Statement.IMP, IBA_Transaction.IMP and IBA_Connection.IMP.
> >What
> >> > are does these tree files do. Now do I have to put them in the
> >same
> >> > folder as the program to make them run properly.
> >> >
> >> > I'm using Borland C++ Builder 5.0.
> >> >
> >> > Simon
> >> >
> >> >
> >> >
> >> >
> >> >
> >
> >
> >
> >
> >
> >
>
>
>
>