J

Pls post more code

Neven

----- Original Message -----
From: "Jeremy Coulter" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Monday, November 12, 2001 8:56 PM
Subject: [DUG]: Class Problem


> Hi all.
>
> I have a component and within the same components unit I have a class
also.
>
> The component creates the class in the create event of the component, and
> the class references the componet.
>
> I.e.
>
>     fMyClass : = TMyClass.create(self);
>
> In the create event of the class I have
>
> constructor TMyClass.Create(AOwner : TMyComponent);
> begin
>   inherited create;
>
>   fOwner :=AOwner;
>   showmessage(inttostr(fOwner.componentindex));
> end;
>
> (fOwner is declared as of type TMyComponent in the private section BTW)
>
> Now the showmessage returns the components index fine, BUT, If I call
> another procedure that has
> "showmessage(inttostr(fOwner.componentindex));" in it, I get an access
> violation !
>
> It is surely something I am doing wrong, but I cant understand what.
> Can someone give me a hint as to what MIGHT be happening or a hint to what
I
> have forgotten to do ?
>
> Cheers, Jeremy Coulter
>
>
>
>

---------------------------------------------------------------------------
    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"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to