|
-
Sep 27th, 2005, 03:37 PM
#1
Thread Starter
Hyperactive Member
problem to get a type for a class defined in ClassLibrary
I created a ClassLibrary. But when I want to get the type of a class defined in that ClassLibrary it is = nothing. When I do the same inside of the ClassLibrary it gives me the type correctly :
Dim myType as Type
myType = Type.GetType("Library.Localisation.Country")
(My ClassLibrary is called "Library" and the Class Country is in the namespace "Localisation").
Thank you very much for any help about this !
Regardes,
Fabian
-
Sep 27th, 2005, 04:06 PM
#2
Re: problem to get a type for a class defined in ClassLibrary
what happens if you do
Dim x as New Library.Localisation.Country
messagebox x.gettype.tostring
-
Sep 28th, 2005, 03:51 PM
#3
Thread Starter
Hyperactive Member
Re: problem to get a type for a class defined in ClassLibrary
Hallo kleinma,
thank you for your help!
What you propose works fine.
The thing is that I would always have to create an instance of a class to use the type. It would be much nicer to just access the type without creating an instance. Why this is possible in the way I have shown in the classLibrary and not outside? Is there any other way to go without creating an instance first?
Anyway - thank you very much for your help!
Regards,
Fabian
Last edited by fabianus; Sep 28th, 2005 at 03:54 PM.
-
Sep 28th, 2005, 04:05 PM
#4
Re: problem to get a type for a class defined in ClassLibrary
you could create a shared function in your class that returns the type, then you would be able to get the type without creating an instance.
-
Sep 28th, 2005, 04:28 PM
#5
Thread Starter
Hyperactive Member
Re: problem to get a type for a class defined in ClassLibrary
ok!
Thank you for your advices.
Regards,
Fabian
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
|