Mu guess is that w/o NODEFAULT VFP tries to add control again after AddObject method finishes.
>I want to place some code in the AddObject method of a container, so I have:
>
>
>** METHOD AddObject
>LPARAMETERS cName, cClass
>
>WITH This
>
> ** Add the control
> DODEFAULT(cName, cClass)
>
> ** Position it show it
> .Controls(1).Top = 1
> .Controls(1).Left = 1
> .Controls(1).Visible = .T.
>
> ** Set up the scroll container
> ._Setup()
>
>ENDWITH
>
>
>
>Then I call:
>
>** Add the control to the container
>ThisForm.MyContainer.AddObject("MyClass", "MyClass")
>
>
>Which runs the code and crashes as it steps out. If I put a NODEFAULT after the _Setup(), it does
>not crash and works fine.
>
>Not sure why this is. Can someone explain this?
>
>K
--sb--