Subject | AV in creating IB based component |
---|---|
Author | Çağatay Tengiz |
Post date | 2002-04-06T09:55:03Z |
Hi list,
I am trying to create a new component for IBO. A treeview (I know there are
lots of it but they do not suit to my needs). I can compile and install
component but when I try to drop it on form I get an AV message sth like
that
"Access Violation at address XXXXXX in module 'IBO40CRT_D6.BPL'. Read of
address FFFFFFFF"
My ssystem specs are
Delphi 6 (no update packs are installed)
IBO 4.2Gc
I defined by componet like
unit IB_TreeView;
{$I IB_Directives.inc}
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls,
IB_Header,
IB_Constants,
IB_Components,
IB_FieldDataLink;
{$DEFINE IB_FieldControl}
{$DEFINE IB_UserClass}
{$DEFINE IB_TreeView}
type
TIB_CustomTreeView = class(TTreeView)
{$I IB_WinControl.INT}
private
FParentField: String;
FChildField: String;
FRootId: Integer;
FPrevState : TIB_DataSetState;
procedure SetChildField(const Value: String);
procedure SetParentField(const Value: String);
procedure SetRootId(const Value: Integer);
protected
procedure Loaded; override;
procedure BuildTree;
public
{ Public declarations }
published
constructor create(AOwner: TComponent); override;
destructor destroy; override;
property ParentField: String read FParentField write SetParentField;
property ChildField: String read FChildField write SetChildField;
property RootId:Integer read FRootId write SetRootId;
end;
TIB_TreeView = Class(TIB_CustomTreeView)
{$I IB_WinControl.PBL}
published
property ParentField;
property ChildField;
end;
implementation
{$I IB_WinControl.IMP}
.
.
.
and registered as
unit IB_TreeViewReg;
interface
{$I IB_Directives.inc}
uses
Classes,
IB_TreeView,
IB_Editors,
{$IFDEF VER140}
DesignIntf,
DesignEditors,
VCLEditors,
PropertyCategories,
{$ELSE}
DsgnIntf,
{$ENDIF}
Windows;
procedure Register;
implementation
procedure Register;
begin
RegisterPropertyEditor(TypeInfo(string), TIB_TreeView, 'ParentField',
TDataFieldProperty);
RegisterPropertyEditor(TypeInfo(string), TIB_TreeView, 'ChildField',
TDataFieldProperty);
RegisterPropertyEditor(TypeInfo(string), TIB_TreeView,
'DataField',TDataFieldProperty);
RegisterDataFieldPropertyEditor(TIB_TreeView);
RegisterComponents('TMD', [TIB_TreeView]);
end;
any ideas?
TIA.
Cagatay Tengiz
_________________________________________________________
Do You Yahoo!?
Get your free @... address at http://mail.yahoo.com
I am trying to create a new component for IBO. A treeview (I know there are
lots of it but they do not suit to my needs). I can compile and install
component but when I try to drop it on form I get an AV message sth like
that
"Access Violation at address XXXXXX in module 'IBO40CRT_D6.BPL'. Read of
address FFFFFFFF"
My ssystem specs are
Delphi 6 (no update packs are installed)
IBO 4.2Gc
I defined by componet like
unit IB_TreeView;
{$I IB_Directives.inc}
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls,
IB_Header,
IB_Constants,
IB_Components,
IB_FieldDataLink;
{$DEFINE IB_FieldControl}
{$DEFINE IB_UserClass}
{$DEFINE IB_TreeView}
type
TIB_CustomTreeView = class(TTreeView)
{$I IB_WinControl.INT}
private
FParentField: String;
FChildField: String;
FRootId: Integer;
FPrevState : TIB_DataSetState;
procedure SetChildField(const Value: String);
procedure SetParentField(const Value: String);
procedure SetRootId(const Value: Integer);
protected
procedure Loaded; override;
procedure BuildTree;
public
{ Public declarations }
published
constructor create(AOwner: TComponent); override;
destructor destroy; override;
property ParentField: String read FParentField write SetParentField;
property ChildField: String read FChildField write SetChildField;
property RootId:Integer read FRootId write SetRootId;
end;
TIB_TreeView = Class(TIB_CustomTreeView)
{$I IB_WinControl.PBL}
published
property ParentField;
property ChildField;
end;
implementation
{$I IB_WinControl.IMP}
.
.
.
and registered as
unit IB_TreeViewReg;
interface
{$I IB_Directives.inc}
uses
Classes,
IB_TreeView,
IB_Editors,
{$IFDEF VER140}
DesignIntf,
DesignEditors,
VCLEditors,
PropertyCategories,
{$ELSE}
DsgnIntf,
{$ENDIF}
Windows;
procedure Register;
implementation
procedure Register;
begin
RegisterPropertyEditor(TypeInfo(string), TIB_TreeView, 'ParentField',
TDataFieldProperty);
RegisterPropertyEditor(TypeInfo(string), TIB_TreeView, 'ChildField',
TDataFieldProperty);
RegisterPropertyEditor(TypeInfo(string), TIB_TreeView,
'DataField',TDataFieldProperty);
RegisterDataFieldPropertyEditor(TIB_TreeView);
RegisterComponents('TMD', [TIB_TreeView]);
end;
any ideas?
TIA.
Cagatay Tengiz
_________________________________________________________
Do You Yahoo!?
Get your free @... address at http://mail.yahoo.com