C# GetType().InvokeMember

  • Thread starter Thread starter Jason Huang
  • Start date Start date
J

Jason Huang

Hi,

In my C# windows form project, I was trying to call a Excel macro.
However, the GetType().InvokeMember was confusing me.
Would some give me some easy sample to tell me what it is?
Thanks for help.


Jason
 
object o = Activator.CreateInstance(ti.Content.GetType());
AgPopupMenu apm = (AgPopupMenu)ti.Content.GetType().InvokeMember("ContextMenu",
System.Reflection.BindingFlags.GetField |
System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, null,
o, new object[] { "aaaa" });



Jason Huang wrote:

C# GetType().InvokeMember
14-Nis-08

Hi

In my C# windows form project, I was trying to call a Excel macro
However, the GetType().InvokeMember was confusing me
Would some give me some easy sample to tell me what it is
Thanks for help

Jason

Previous Posts In This Thread:

On 14 Nisan 2008 Pazartesi 07:00
Jason Huang wrote:

C# GetType().InvokeMember
Hi

In my C# windows form project, I was trying to call a Excel macro
However, the GetType().InvokeMember was confusing me
Would some give me some easy sample to tell me what it is
Thanks for help

Jason

EggHeadCafe - Software Developer Portal of Choice
Quick and easy SHA1 Hash of a String
http://www.eggheadcafe.com/tutorial...9e-9eef3f2bbad1/quick-and-easy-sha1-hash.aspx
 
object o = Activator.CreateInstance(ti.Content.GetType());
AgPopupMenu apm = (AgPopupMenu)ti.Content.GetType().InvokeMember("ContextMenu",
System.Reflection.BindingFlags.GetField |
System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, null,
o, new object[] { "aaaa" });



Jason Huang wrote:

C# GetType().InvokeMember
14-Nis-08

Hi

In my C# windows form project, I was trying to call a Excel macro
However, the GetType().InvokeMember was confusing me
Would some give me some easy sample to tell me what it is
Thanks for help

Jason

Previous Posts In This Thread:

On 14 Nisan 2008 Pazartesi 07:00
Jason Huang wrote:

C# GetType().InvokeMember
Hi

In my C# windows form project, I was trying to call a Excel macro
However, the GetType().InvokeMember was confusing me
Would some give me some easy sample to tell me what it is
Thanks for help

Jason

On 04 Kasim 2009 ?arsamba 08:51
Hamit YILDIRIM wrote:

InvokeMember
object o = Activator.CreateInstance(ti.Content.GetType());
AgPopupMenu apm = (AgPopupMenu)ti.Content.GetType().InvokeMember("ContextMenu",
System.Reflection.BindingFlags.GetField |
System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, null,
o, new object[] { "aaaa" });

EggHeadCafe - Software Developer Portal of Choice
C# and GDI : draw Round rectangles, fonts, ellipse, fonts
http://www.eggheadcafe.com/tutorial...8f96-f7b6c502a6e2/c-and-gd--draw-round-r.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top