[Lazarus] object casting to pointer

Michael Van Canneyt michael at freepascal.org
Wed Nov 24 00:24:40 CET 2010



On Tue, 23 Nov 2010, Marco Aurelio Ramirez Carrillo wrote:

> Hi.
> I'm working witha TTreeview, and trying to assign a object to a
> TTreeNode.data property:
>
> <code>
> MyTreeNode := myTreeview.add(nil, "MyTreeNode");
>
> // any "TObject" descendant class
> MyObject = MyClass.Create();
>
> // all of these, generate a syntax/semantic error:
>
> // no typecasting
> MyTreeNode.Data := MyObject;

I do this every day ? What is the error you get ?

Michael.




More information about the Lazarus mailing list