|
-
Feb 4th, 2009, 07:46 PM
#1
Thread Starter
Lively Member
testing a class
for the lesson here, http://msdn.microsoft.com/en-us/library/ms172603.aspx
i followed everything to the letter, and this is visual studio 2005, but the editor does not recognize the class,
Dim person1 As New persons.persons
the msg is : 'type persons.persons is not defined'
i've checked a lot and all the names look correct to me, must be something simple i've missed?
bob
-
Feb 5th, 2009, 05:14 AM
#2
Re: testing a class
Thread moved from 'VB6 and Earlier' forum to 'VB.Net' (VB2002 and later) forum
-
Feb 5th, 2009, 06:25 AM
#3
Re: testing a class
Is the 'persons' class inside a namespace called 'persons'? Have you referenced the classTest project from your form's project?
-
Feb 5th, 2009, 06:46 AM
#4
Re: testing a class
If you've added the reference correctly then it should work. That said, if you also imported the 'persons' namespace then you'd break it again. If you HAVE imported the 'persons' namespace into your WinForms project then you should be using 'persons' only, not 'persons.persons'.
-
Feb 6th, 2009, 02:29 PM
#5
Thread Starter
Lively Member
Re: testing a class
thanks for the reply, it was a rookie naming issue, when i created the class, i didn't realize it would be recognized, for purposes of identifying the class, by the name given at creation. it used the ide default, classLibrary1, so even tho i had named the project and the .vb, 'persons', it still needs the 'object' name.
so, i'm guessing to keep the class, project, and .vb name all the same?
and also if i make the class into a dll, and add to the components, via component services, the component name will end up being the class name?
bob
-
Feb 6th, 2009, 02:36 PM
#6
Re: testing a class
I wouldn't necessarily keep the class name the same. You could easily have more than one class in a library, and you certainly couldn't share the name with them, but the other names might as well stay the same to make them easy to keep track of.
My usual boring signature: Nothing
 
-
Feb 7th, 2009, 04:16 PM
#7
Thread Starter
Lively Member
Re: testing a class
just want to get the terminology correct, about the library? and component services
there is the 'class library' that is the ide new project, and there is the component services. is component services considered a library as well? my understanding to make classes accessible to any program/project (they would show in the object browser) you would save them as a dll and then add them to component services?
or alternatively you can add any existing dll to a project in the object browser
what are differences and /or reasons to go the component services route as opposed to adding specific dll's through the object browser?
i'm bracing for being forwarded to a set of 2" thick manuals to answer these questions.
bob
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
|