[lazarus] Custom LCL components still bugging me

Tony Maro tony at maro.net
Thu Nov 14 10:58:08 EST 2002


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



NOTE: editor options config file not found
Note: codetools config file not found - using defaults
TPascalParserTool.BuildTree B OnlyIntf=TRUE  /home/tonym/Projects/test/unit1.pas
TMainIDE.DoOpenEditorFile END "/home/tonym/Projects/test/unit1.pas"
************************************************************
MouseDownOnControl Form1:TForm1 No Shift down, No CTRL down
[TDesigner.MouseDownOnControl] END
************************************************************
MouseUpOnControl Form1:TForm1
[TCustomFormEditor.CreateComponent] Class='TESDSOUND'
opInsert
TPascalParserTool.BuildTree B OnlyIntf=TRUE  /home/tonym/Projects/test/unit1.pas
TPascalParserTool.BuildTree B OnlyIntf=FALSE  /home/tonym/Projects/test/unit1.pas
NEW COMPONENT ADDED: Form.ComponentCount=1  NewCI.Control.Owner.Name=Form1
[TDesigner.MouseLeftUpOnControl] END
************************************************************
MouseDownOnControl Form1:TForm1 No Shift down, No CTRL down
[TDesigner.MouseDownOnControl] END
************************************************************
MouseUpOnControl Form1:TForm1
[TCustomFormEditor.CreateComponent] Class='TBUTTON'
opInsert
Parent is 'Form1'
TPascalParserTool.BuildTree B OnlyIntf=TRUE  /home/tonym/Projects/test/unit1.pas
TPascalParserTool.BuildTree B OnlyIntf=TRUE  /home/tonym/Projects/test/unit1.pas
TPascalParserTool.BuildTree B OnlyIntf=FALSE  /home/tonym/Projects/test/unit1.pas
NEW COMPONENT ADDED: Form.ComponentCount=2  NewCI.Control.Owner.Name=Form1
[TDesigner.MouseLeftUpOnControl] END
### TMethodPropertyEditor.GetValues
[TEventsCodeTool.GetCompatiblePublishedMethods] A UpperClassName=TFORM1
TPascalParserTool.BuildTree B OnlyIntf=TRUE  /home/tonym/Projects/test/unit1.pas
[TEventsCodeTool.GetCompatiblePublishedMethods] B TRUE
[TEventsCodeTool.GetCompatiblePublishedMethods] C TRUE
[TEventsCodeTool.GetCompatiblePublishedMethods] D
[TEventsCodeTool.CreateExprListFromMethodTypeData] START
[TEventsCodeTool.CreateExprListFromMethodTypeData] A  i=0/1 Ident=TOBJECT
TPascalParserTool.BuildTree B OnlyIntf=TRUE  /home/tonym/lazarus/lcl/buttons.pp
[TEventsCodeTool.CreateExprListFromMethodTypeData] B  i=0/1 Ident=TOBJECT CurExprType=Desc=None SubDesc=None
[TEventsCodeTool.CreateExprListFromMethodTypeData] END
[TEventsCodeTool.GetCompatiblePublishedMethods] E Searching ...
#################### TOIPropertyGrid.ValueButtonClick
### TMethodPropertyEditor.Edit A OldValue=
### TMethodPropertyEditor.Edit B FormMethodName=Button1CLICK
### TMethodPropertyEditor.SetValue A OldValue="" NewValue=Button1CLICK
[TEventsCodeTool.PublishedMethodExists] A UpperClassName=TFORM1
[TEventsCodeTool.PublishedMethodExists] B TRUE
TPascalParserTool.BuildTree B OnlyIntf=FALSE  /home/tonym/Projects/test/unit1.pas
[TEventsCodeTool.CreatePublishedMethod] A AMethodName="Button1CLICK" in "/home/tonym/Projects/test/unit1.pas"
### TCodeToolManager.HandleException: "EACCESSVIOLATION: Access violation" at Line=8 Col=70 in "/home/tonym/Projects/test/unit1.pas"
An unhandled exception occurred at 0x081AF14E :
Unable to create new method. Plz fix errors in source.
  0x081AF14E  TMAINIDE__ONPROPHOOKCREATEMETHOD,  line 7144 of main.pp

[TMainIDE.Destroy] A
An unhandled exception occurred at 0x0818665F :
Access violation
  0x0818665F  TAVLTREENODEMEMMANAGER__DISPOSENODE,  line 998 of avl_tree.pas
  0x4C373A3B  main,  line 302 of lcllinux.pp
  0x0000D7B2

forms.pp - finalization section
An unhandled exception occurred at 0x0818665F :
Access violation
  0x0818665F  TAVLTREENODEMEMMANAGER__DISPOSENODE,  line 998 of avl_tree.pas
  0x0824C48C
  0x0000D7B2






More information about the Lazarus mailing list