Paul,

Your assign procedure may need to call other assign procedures eg:

procedure TMyObj.Assign(Source : TPersistent);
var
  s : TMyObj;
begin
  s := Source as TMyObj;
.
  MyFont := s.MyFont;  { This will give the symptoms you describe }
.
  MyFont.Assign(s.MyFont);  { This will copy the properties into your
object }
.
end;

Obviously you'll need to create the font object in your constructor and
destroy in the destructor.

Hope this helps,
Carl.

----- Original Message -----
From: "logman0u812" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, September 27, 2005 3:17 AM
Subject: [delphi-en] assign an object


> hey all,
> I have a component and I want to copy this component
> into a collection. I use the "assign" method.  Its
> works, but all the sub-properties of the component can
> not be changed. I mean the copied components
> subproperties are there, but if you change any of the
> sub-properties values it will also change the original
> components properties to be exactly the same. So
> basically I have a clone, and all the sub-properties
> will be always the same in all the components in the
> collection.
>
> When I assign the component, I have tried to assign
> the TPersistent sub-properties at the same time but it
> didnt help. It actually made my application very
> unstable. Delphi hangs and froze alot.
>
> thanx in advance for any help
> Paul
>
> __________________________________________________
> 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
>
>
>
>
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
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/
 


Reply via email to