Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Category:
Object Oriented Programming
>>I was passing in an object, oHandler, to another object, oxServer, but decided I want to create oHandler inside oxServer instead, to keep everything encapsulated so references are easier to make. What decides when to use NewObject, CreateObject or AddObject? I was using CreateObject for oHandler, then passing it in, but what's the correct way to do it inside oxServer? Why?
>
>You use Newobject() and AddObject() methods to add objects (controls) to a container. An example would be adding label, button, etc. to a form during runtime.
>The Newobject() and CreateObject() functions used to create object that do not belong to container but rather are refereced by it.
So, NewObject can be used in either case. AddObject is only used with a container. CreateObject would be used in a non-visual, non-container class. I can use either NewObject or CreateObject in my case then. Why even have CreateObject if NewObject can do the same thing?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only