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 / August 2005

Tip: Looking for answers? Try searching our database.

Problem with GetType().InvokeMember

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vinoth@gsdindia.com - 24 Aug 2005 11:44 GMT
Hi,

 I have a object which is created by using the Assembly.CreateInstance

method.

Assembly testAss = Assembly.LoadWithPartialName("­Test");
object obj = testAss.CreateInstance("Sample­1.SampleTest");
//This obj is the instance of SampleTest Class

Upto this the cod is working fine.

When i try to invoke one method of the SampleTest Class with obj its
giving the result object Undefined Value.

This is my code.

object[] Parameters = new object[2];
Parameters[0] = methodName;//It is string
Parameters[1] = clientReqAL;//clientReqAL is the ArrayList Containing
Two Values(string).
if(wrapperInst!=null)
{
object result =  obj.GetType().InvokeMember("Te­stMethod",
BindingFlags.InvokeMethod,null­,obj,Parameters);

}

How can i solve this problem .If anybody knows the solution let me
know.

Thanks,
Vinoth
Mattias Sjögren - 24 Aug 2005 16:46 GMT
>When i try to invoke one method of the SampleTest Class with obj its
>giving the result object Undefined Value.

And what do you expect the return value to be? Undefined Value just
means null, which not necessarily is an error.

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.