Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. MethodInfo.Invoke urgent help please

MethodInfo.Invoke urgent help please

Scheduled Pinned Locked Moved C#
comhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hasansheik
    wrote on last edited by
    #1

    Hi all, when i am executing the following code the, if the function invoked returning other than null, it is working fine. if it returns null, then it throws the object reference not found exception. please help. string functionName ="GetMRN"; System.Reflection.MethodInfo methodinfo; methodinfo = this.GetType().GetMethod(functionName); objParamArr[0] = Param2; objParamArr[1]=param2; string strResult = methodinfo.Invoke(Invoke(this,objParamArr).ToString(); regards. HAsan Contact him at: hasansheik@hotmail.com hasansheik@yahoo.co.in hasansheik@lycos.com

    L 1 Reply Last reply
    0
    • H hasansheik

      Hi all, when i am executing the following code the, if the function invoked returning other than null, it is working fine. if it returns null, then it throws the object reference not found exception. please help. string functionName ="GetMRN"; System.Reflection.MethodInfo methodinfo; methodinfo = this.GetType().GetMethod(functionName); objParamArr[0] = Param2; objParamArr[1]=param2; string strResult = methodinfo.Invoke(Invoke(this,objParamArr).ToString(); regards. HAsan Contact him at: hasansheik@hotmail.com hasansheik@yahoo.co.in hasansheik@lycos.com

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      hasansheik wrote: string strResult = methodinfo.Invoke(Invoke(this,objParamArr).ToString();

      object result = methodinfo.Invoke(Invoke(this,objParamArr);
      string strresult = (result == null) ? "NULL" : result.ToString();

      xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups