Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 3rd, 2007, 05:13 PM
Authorized User
Join Date: Apr 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Get Class from String?

Hi Gang,

I am trying to do something that I am pretty sure will work, but I cannot get over one hurdle...

I have a StringCollection of strings representing Classes. What I want to do is iterate over them, find the class each one names, and then invoke a shared function on that class.

I have been trying something like:
Dim bo As Type

bo = Type.GetType(stringName)
bo.invokeMember("sharedFunctionName", Reflection.BindingFlags.FlattenHierarchy, Nothing, Nothing, Nothing)
The problem with the code is the Type.GetType throws an error that it cannot find a class with the name I specify, which exists in the same project).

Secondly, if I overcome that hurdle, I do not understand the 4th param in the invokeMember function, which is the "target". Can someone please explain that to me? Isn't the target in this case bo, the object I am sending the invokeMember message to?



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to extend the String class hafizmuhammadmushtaq Java Basics 2 April 7th, 2008 06:21 AM
Invalid class string CH 6 itpro2 BOOK: Beginning ASP 3.0 0 May 22nd, 2006 05:15 PM
Invalid class string - : 0x800401F3 not24 C# 2005 1 March 16th, 2006 04:53 PM
Adding functionality to the String class? RobMeade BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 5 February 9th, 2005 02:11 PM
String class dotnetprogrammer VS.NET 2002/2003 0 November 20th, 2004 01:30 AM

All times are GMT -4. The time now is 05:23 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.