[lazarus] Custom LCL components still bugging me

andrew johnson acjgenius at earthlink.net
Thu Nov 14 11:20:05 EST 2002

well.. first things first.. realocmem can have unpredictable results on
an uninitialized block.. since this is uninitialized it might be
contributing to the problem. You should instead init it with SoundFiles
:= nil;


On Thu, 2002-11-14 at 11:07, Tony Maro wrote:
> In my ongoing effort to figure out why my custom controls aren't working
> right from the IDE, I've run into something new.
> If I compile into Lazarus JUST the TESDSound component I've made, create
> a new project, drop it on the form...
> Then drop a button on the form and try to add an onclick event to the
> button Lazarus crashes.  (console output is attached)
> Something odd is definately going on with custom components compiled in
> - it MIGHT be my component code, so I'm not pointing fingers ;-)
> The component by itself is available (if you haven't already downloaded
> the cbbad.tgz from my previous mail) at:
> http://members.telocity.com/~tonymaro/esdsound.tgz
> The only place that I would think my code could affect things is in the
> .create method which is simply:
> constructor TESDSound.Create(AOwner: TComponent);
> begin
>      Reallocmem(SoundFiles, 0);
>      NumSoundFiles := 0;
>      inherited Create(AOwner);
>      if csDesigning in ComponentState then exit;
>      // design time affect should stop here...
>      if enabled then begin
>         SetEnabled(True);
>      end;     
> end;
> Thanks,
> Tony

More information about the Lazarus mailing list