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
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
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
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.
Re: problem to get a type for a class defined in ClassLibrary
ok!
Thank you for your advices.
Regards,
Fabian