You have to set the Parent property of the newly created Class;

i.e MyListView1.Parent := Self;

-----Original Message-----
From: Chrissy R [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 29 November 2000 15:51
To: Multiple recipients of list delphi
Subject: [DUG]: Creating A Class


Hi,

I am trying to create, at run time, a number of instances of a TTreeView.  I
have
created a class of this type and I will add some methods to this.  I can
create this
in one unit and, when I press a button on my form, things seem to work but I

cannot get this new object to display.  The code that I have for the button
click is

procedure TForm1.Button1Click(Sender: TObject);
var
  MyList1, Q: PMyList;
begin
  New(Q);
  MyList1 := Q;
  MyList1.Visible := True;
end;

The MyList1.Visible line fails with an access violation and I do not know
what
I am doing.  Please help me.

Chrissy.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"



CAUTION - This message may contain privileged and confidential information intended 
only for the 
use of the addressee(s) named above.  If you are not the intended recipient of this 
message you are 
hereby notified that any use, dissemination, distribution or reproduction of this 
message is prohibited.  
If you have received this message in error please notify Progressive Enterprises Ltd. 
immediately via 
email at [EMAIL PROTECTED]  Any views expressed in this message 
are those of the 
individual sender and may not necessarily reflect the views of Progressive Enterprises 
Ltd.

This footnote also confirms that Progressive Enterprises Ltd. has swept this email 
message for the 
presence of computer viruses.  This does not guarantee this message is virus free.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to