>In VFP6, I create an application object that is based on the custom class. This object holds all my app properties such as LoginID, FiscalYear, etc.
>
>Now I have a created a class based on my form subclass. Is there a way to use NewObject() to add this object to oApp? The code below works fine, but I am trying to learn what this new function will and will not do.
>oApp = newobject("AppMgr", "AppManager.vcx")
>set classlib to AppClass.vcx
>oApp.AddObject("oGPRA", "TravGPRA")
>TIA!
Is your app object a container and you want to add the form as a member?
Or is it a custom class, and you just need a reference to the form?
I don't know of a way to use NewObject syntax with Addobject, but you can always addProperty to the custom object, and just store a reference:
oApp.AddProperty('oForm',NEWOBJECT("AppMgr","AppManager.vcx"))
But since this reference is a reference and not a contained object, you will have to deal with NULLing it out in the oApp's destroy method.
Erik Moore
Clientelligence