PC Review


Reply
Thread Tools Rate Thread

calling a method on a object that you know the string name for.

 
 
scotty
Guest
Posts: n/a
 
      12th Jan 2007

say you have an object, and you want to call a method, but that method
name is a string.

is there a way to execute this method?

obviously, you can't do

obj.methodname

need something like

Invoke(obj, "methodname")... to execute that method on the object.

 
Reply With Quote
 
 
 
 
jeff.j.griffith@gmail.com
Guest
Posts: n/a
 
      12th Jan 2007
Check out CallByName. I think it does what you're talking about.


scotty wrote:
> say you have an object, and you want to call a method, but that method
> name is a string.
>
> is there a way to execute this method?
>
> obviously, you can't do
>
> obj.methodname
>
> need something like
>
> Invoke(obj, "methodname")... to execute that method on the object.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling a method on an object created in a different addin scotty Microsoft Excel Programming 1 12th Jan 2007 02:32 PM
object calling outside method Pujo Aji Microsoft C# .NET 1 21st Jan 2005 11:37 AM
Calling a method using a string value? =?Utf-8?B?amFjZXc=?= Microsoft C# .NET 1 16th Feb 2004 05:00 PM
Calling Method of Unknown Object Vinod I Microsoft C# .NET 4 31st Dec 2003 08:22 AM
Calling C# method from VB and passing object by reference robertm Microsoft ASP .NET 1 20th Aug 2003 04:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:20 PM.