Adding to an existing NameSpace

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

After creating a namespace in one file how would I add to that a new object
in the same namespace in a diffrent file?

IE
FILE1 contains namespace FINANCE
FILE2 has object that want to exist in the FINANCE namespace

Can this be done without adding the classes to FILE1?

Thanks
Davinci
 
Davinci_Jeremie said:
After creating a namespace in one file how would I add to that a new object
in the same namespace in a diffrent file?

IE
FILE1 contains namespace FINANCE
FILE2 has object that want to exist in the FINANCE namespace

Can this be done without adding the classes to FILE1?

Just declare the namespace again. Note that you're not adding an
*object* to a namespace, you're adding a *type* to a namespace.
 
Yes.

Just declare the classes in FILE2 to be in the namespace you want them
in.

Projects using classes from that namespace will not know that the
namespace is in more than one DLL unless you refer to something defined
in that namespace but in a DLL that your project doesn't contain a
reference to. If you do this, the compiler will complain that it can't
find that class (or whatever) in that namespace, and maybe you're
missing a DLL reference?

If you write a project that only ever refers to things in FILE1, the
compiler doesn't know that there is "more" of the same namespace in
FILE2, and doesn't care.
 
Back
Top