About custom balloon

Posted:
December 15th, 2005, 10:16 am
by alexhaifa
Hi, I would like whether I am creating my custom balloon correctly. Because sometimes I get an error with balloon in windows 2000 and xp.
FBLNW01 is a balloon
Agente is the assistent
- Code: Select all
FBLNW01 := TFBLNW01.Create(Self);
Try
Agente.AutoIdle := False;
If Not Agente.Showing Then
Begin
Agente.Show;
MoveAleatorio;
End;
Agente.CustomDialog := FBLNW01;
Agente.ShowCustomModal;
Finally
FBLNW01.Release;
FBLNW01 := Nil;
End;
FechaPrograma.Enabled := True;

Posted:
December 15th, 2005, 7:34 pm
by Kambiz
For
Owner of the forms use
Application:
- Code: Select all
FBLNW01 := TFBLNW01.Create(Application);
And, instead of
Release always use
Free:
- Code: Select all
FBLNW01.Free;
These may fix the problem.

Posted:
December 16th, 2005, 3:05 pm
by alexhaifa
I am gonna try this, thanks once again

Posted:
December 16th, 2005, 11:13 pm
by alexhaifa
Kambiz, I noticed that If the custom balloon is created when the program is called, not only when I call the custom balloon as I was doing, there is no error. But if I close the custom ballon and use free, after three calling or more, I got an error.
Here the balloon is created, and not as I was doing. There isn't any error this way.
Application.Initialize;
Application.CreateForm(TFMENU, FMENU);
Application.CreateForm(TFBLNW01, FBLNW01);
Application.Run;
But I need to use it only this way.
Agente.CustomDialog := FBLNW01;
Agente.ShowCustomModal;
If I give free after close the balloon, after three times or more I got an error.
Please check this for me. My project is gonna have more than 15 custom balloon
Thanks

Posted:
December 17th, 2005, 10:05 am
by Kambiz
Set Agente.CustomDialog to nil before releasing the balloon.

Posted:
December 19th, 2005, 12:25 pm
by alexhaifa
Kambiz, once again thanks.
It didn't give me problem anymore.
Alex