|
-
Dec 11th, 2003, 08:10 PM
#1
Thread Starter
Hyperactive Member
Namespaces? [RESOLVED...]
Thre are 3-4 modules (subprojects) in my application. Even their locations are also different. Now how can I access the classes defined into other module? I have given the same root namespace for all the modules. How to proceed now?
Can anyone pls. explain me?
Ani
Last edited by anita2002; Dec 11th, 2003 at 08:35 PM.
Can't imagine life without VB
(Various Boyfriends)
-
Dec 11th, 2003, 08:13 PM
#2
Fanatic Member
Uh? As far as I know, the namespaces, or more simply put, the name of the class or module CAN'T be the same as another and the CAN'T start with a number.
-
Dec 11th, 2003, 08:20 PM
#3
Thread Starter
Hyperactive Member
Originally posted by nkad
Uh? As far as I know, the namespaces, or more simply put, the name of the class or module CAN'T be the same as another and the CAN'T start with a number.
Class names are differnt. I have some modules (having different names) and different paths. But I have given the same rootnamespace name because I want to access classes from module in other module. So how this can be achieved?
If I specify different namespaces then can I Import the other namespace and access its functionalities?Pls. explain.
Can't imagine life without VB
(Various Boyfriends)
-
Dec 11th, 2003, 08:23 PM
#4
I wonder how many charact
If all your modules(which are just classes in .Net), are in the same project directory... you don't need to explicity declare a namespace...they inherit the namespace from your project.
If they are in different places, you must right-click your Project you will be using them in... Add Reference... and with the .Net tab selected.. click Browse.. and select the dll from your compiled classes.
Then use...
VB Code:
Imports YourNameSpace.YourClass
in any class in your main project that needs to use those classes.
-
Dec 11th, 2003, 08:23 PM
#5
Fanatic Member
What do you mean 'rootnamespace'. Can you give me an example of your setup?
-
Dec 11th, 2003, 08:28 PM
#6
I wonder how many charact
If you have 3 projects in a solution...
And you want to use code from the project 2...
You simply add a reference for Project 2 as I described above to Project 1. In any class you want to use the reference... use Imports Project2
-
Dec 11th, 2003, 08:31 PM
#7
Thread Starter
Hyperactive Member
Thanks nemaroller & nkad. I got that now.
BTW, 'rootnamespace' means the project namespace. U can find this in Project properties.
Can't imagine life without VB
(Various Boyfriends)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|