Hmm... last brain teasing before going to weekend :) I don't see
anything that might lead to an Access violation error here it's probably in
some other event... correct me someone if I'm wrong
Did you try to trace your codes to see where exactly the exception is
raised? Try to create a blank form, drop one of your TWTParse on it and run
the application without writing any code in it, to see if the error comes
from the component itself or from your codes in one of your units that uses
this component..
Good luck
Vahan
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf
Of logman0u812
Sent: Friday, June 17, 2005 5:13 PM
To: [email protected]
Subject: [delphi-en] Component creation and TStrings
hey all,
Im new to creating components, and Im having a problem
getting rid of an error in one of my components. The
exception is an EAccessViolation whenever I quit my
test application that used one my components. And I
know it has to do with the TStrings that Im using
inside the component. Im freeing the TStrings when the
component is destroyed but the error still persists.
here is some code from the parsing component:
TWTParse = class(TComponent)
private
FRowCount: integer;
FCellCount: integer;
FHeadersCount: integer;
FRemoveHeaders: boolean;
FRawTable : TStrings;
FSortedTable: TStrings;
FDelimitedTable: TStrings;
FTableHeaders: TStrings;
FCellDelimiter: char;
FRowDelimiter: char;
// etc .......
protected
procedure SetRawTable(newValue: TStrings);
virtual;
function GetRawTable: TStrings; virtual;
procedure SetCellDelimiter(newValue: char);
virtual;
procedure SetRowDelimiter(newValue: char);
virtual;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure ParseData;
procedure ThreadParseData;
function Execute: Boolean;
function TableRowCount: Integer;
function TableCellCount: Integer;
function TableHeadersCount: Integer;
function RawTable: TStrings;
function SortedTable: TStrings;
function DelimitedTable: TStrings;
function HeadersTable: TStrings;
function SortTable(tstr: TStrings): TStrings;
published
property CellDelimiter: char read FCellDelimiter
write SetCellDelimiter default #127;
property RowDelimiter: char read FRowDelimiter
write SetRowDelimiter default #127;
property RemoveHeaders: boolean read
FRemoveHeaders write FRemoveHeaders default true;
property Data: TStrings read GetRawTable write
SetRawTable;
// - events etc...
end;
constructor TWTParse.Create(AOwner: TComponent);
begin
inherited Create(aOwner);
FSortedTable := TStringlist.Create;
FRawTable := TStringlist.Create;
FDelimitedTable := TStringlist.Create;
FTableHeaders := TStringlist.Create;
FTableRowCount := 0;
FTableCellCount := 0;
end;
destructor TWTParse.Destroy;
begin
FDelimitedTable.Free;
FRawTable.Free;
FSortedTable.Free;
FTableHeaders.Free;
inherited Destroy;
end;
I know Im probably missing something simple, so can
someone please open my eyes :)
Thank you for your time....
Frank
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
----------------------------------------------------------------------------
----
Yahoo! Groups Links
a.. To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
b.. To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/