Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2004

Tip: Looking for answers? Try searching our database.

Reflection (again!)--how do I identify a Visual Basic Module?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff Johnson [MVP: VB] - 11 May 2004 22:24 GMT
Subject pretty much says it all. When iterating over GetTypes(), Modules
have their IsClass property set to True (and there's obviously no IsModule
property--I'm not THAT dense), so currently my code is interpreting them as
classes. Any suggestions?
Mattias Sj?gren - 11 May 2004 23:00 GMT
Jeff,

Modules have the custom attribute
Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute applied
to them, you can check if it's there with Type.GetCustomAttributes.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Jeff Johnson [MVP: VB] - 12 May 2004 19:31 GMT
> Modules have the custom attribute
> Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute applied
> to them, you can check if it's there with Type.GetCustomAttributes.

Many thanks. Now how can I tell if a type is a Structure? And is there any
one place I could look to find this information for myself? (Besides this
group, of course....)
Mattias Sj?gren - 12 May 2004 23:47 GMT
Jeff,

>Now how can I tell if a type is a Structure?

Type.IsValueType

>And is there any
>one place I could look to find this information for myself? (Besides this
>group, of course....)

I'm sure there must be some decent articles on Reflection out there,
but unfortunately I don't know any I can point you to. But pretty much
everything you'd want to know about a type is available from
System.Type.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.