Root namespace in vb.net

V

Viet

Is it possible to instantiate an object from the Root namespace? I have a MS
Visual Studio 2002 vb.net project consisting of a dozen individual project
files and I would like to know how to transfer messages from project to
another within the Solution Explorer.
 
H

Herfried K. Wagner [MVP]

Viet said:
Is it possible to instantiate an object from the Root namespace? I have a
MS
Visual Studio 2002 vb.net project consisting of a dozen individual project
files and I would like to know how to transfer messages from project to
another within the Solution Explorer.

You can reference other DLL projects from within DLL/EXE projects. It's not
supported to reference an EXE project from another project. To add a
reference, right-click the project in the solution explorer, choose "Add
reference...", and select the project in the projects tab.
 
V

Viet Pho

Thanks for your reply.

All my project files are exe format. For me to add a reference to the
project, I have save them as a dll which won't do (because of the code).
Is there another way?
Thanks,
Viet
 
H

Herfried K. Wagner [MVP]

Viet Pho said:
All my project files are exe format. For me to add a reference to the
project, I have save them as a dll which won't do (because of the code).
Is there another way?

No.
 
S

Scott M.

You can actually just change the file extension from .exe to .dll and you'll
be able to make the references and use the objects. You will NOT be able to
run those projects directly anymore, however.
 
V

Viet

Since the root namespace is essentially another namespace, can't I just
declare a namespace class and have it reference the root namespace?
 
S

Scott M.

What do you mean by the root namespace being "another" namespace?

Namespaces are just labels that designate how to organize and group classes
and interfaces. How and why you make references is not affected by
namespaces.

Namespaces are used to refer to a class. Imports statements are used so
that you don't have to refer to the namespace that a class is in.
Namespaces and references are two distinct and different things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top