Subject Re: [IBO] OT: String->Query
Author Marc Leclerc
Hi,

Set a breakpoint in the destructor of your TCustomersForm. You will see that
the app will take care of freeing your form. The exception will occur on
your call to free since it's already gone.

HTH

----- Original Message -----
From: <guido.klapperich@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, April 09, 2001 1:42 PM
Subject: Re: [IBO] OT: String->Query


> Yes, is this a problem ?
>
> Marc Leclerc wrote:
>
> > Are you trying to free manualy ?
> >
> > ----- Original Message -----
> > From: <guido.klapperich@...>
> > To: <IBObjects@yahoogroups.com>
> > Sent: Sunday, April 08, 2001 7:17 PM
> > Subject: Re: [IBO] OT: String->Query
> >
> > > Now Application is the owner of my forms:
> > > CustomersForm:=TCustomersForm.Create(Self) has become
> > > CustomersForm:=TCustomersForm.Create(Application)
> > >
> > > but now I get an AV, when I close my app.
> > > Any ideas ?
> > >
> > > Guido
> > >
> > > guido.klapperich@... wrote:
> > >
> > > > Thanks Markus, that's exactly, what I have been looking for. But
only my
> > MainForm
> > > > has the owner Application, I thought every form has this owner ?
> > > >
> > > > Guido
> > > >
> > > > Markus Ostenried wrote:
> > > >
> > > > > Hi Guido !
> > > > >
> > > > > If your DataModules all have the Owner "Application" you can do
> > something like:
> > > > >
> > > > > function FindQuery( AName: String ): TIB_Query;
> > > > > var
> > > > > p, i, j : Integer;
> > > > > sDataModule, sQuery: String;
> > > > > DM : TDataModule;
> > > > > begin
> > > > > Result := nil;
> > > > > p := Pos( '.', AName );
> > > > > if (p = 0) then Exit;
> > > > > sDataModule := Copy( AName, 1, p-1 );
> > > > > Delete( AName, 1, p );
> > > > > sQuery := AName;
> > > > > for i := 0 to Application.ComponentCount-1 do begin
> > > > > if (Application.Components[i].Name = sDataModule) then begin
> > > > > DM := (Application.Components[i] as TDataModule);
> > > > > for j := 0 to DM.ComponentCount-1 do begin
> > > > > if (DM.Components[i].Name = sQuery) then begin
> > > > > Result := (DM.Components[i] as TIB_Query);
> > > > > Break;
> > > > > end; // if Com.Name = sQuery
> > > > > end; // for j
> > > > > end; // if Com.Name = sDataModule
> > > > > end; // for i
> > > > > end;
> > > > >
> > > > > not tested - just coded....
> > > > >
> > > > > HTH,
> > > > > Markus
> > > > >
> > > > > At 23:14 08.04.2001 +0200, you wrote:
> > > > > >I have a string 'CustomersDataModule.CSQuery' and I want to
convert
> > this
> > > > > >string to a IB_Query.
> > > > > >I want something like that:
> > > > > >
> > > > > >var Query; TIB_Query;
> > > > > >begin
> > > > > > Query:=Convert('CustomersDataModule.CSQuery');
> > > > > > Query.Open;
> > > > > >end;
> > > > > >
> > > > > >Is this possible ?
> > > > > >
> > > > > >
> > > > > >Guido.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> > > >
> > > >
> > > >
> > > >
> > > > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> > >
> > >
> > > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> > >
> > >
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>