type.invokemember

  • Thread starter Thread starter Daryl Davis
  • Start date Start date
D

Daryl Davis

Can someone help me with this. I am reading the MSDN on this but it is
making almost no sense to me.
this is what I understand
InvokeMember(String, BindingFlags, Binder, Object, Object()) As Object
The first param is the name of the method I wish to call.
The second param is what type of method I am calling (public, nonPublic,
etc...)
The third Param, I have no clue
The forth param is the target, I am unsure what that means
The fifth param is an array of arguments, Are these the arguments for the
method? I don't know.

Thank you
Daryl Davis
 
The third Param, I have no clue

From the documentation: "[Binder] object that defines a set of properties
and enables binding, which can involve selection of an overloaded method,
coercion of argument types, and invocation of a member through reflection. "
The forth param is the target, I am unsure what that means

It's the object on which to invoke the member specified as first parameter
The fifth param is an array of arguments, Are these the arguments for the
method? I don't know.

Yes
 
Daryl Davis said:
Can someone help me with this. I am reading the MSDN on this but it is
making almost no sense to me.
this is what I understand
InvokeMember(String, BindingFlags, Binder, Object, Object()) As Object
The first param is the name of the method I wish to call.
Yes.

The second param is what type of method I am calling (public, nonPublic,
etc...)
Yes.

The third Param, I have no clue

You should be fine with just null.
The forth param is the target, I am unsure what that means

It's the object to invoke the method on.
The fifth param is an array of arguments, Are these the arguments for the
method? I don't know.

Yes.
 
Hello Jon

I am trying to understand this too. Eventhough I think I understand InvokeMember I am not sure if I am getting the syntax correct. For details what I am trying to do see the post at microsoft.public.dotnet.framework titled, "Filling Public Properties in a class from a database"

I am trying to fill public properties from a database with tC.InvokeMember("DatabaseColumnName", BindingFlags.Default Or BindingFlags.SetProperty, Nothing, tC, "DataBaseColumnValue"). Is this the correct syntax for doing what I want

Thanks
Charle


----- Jon Skeet [C# MVP] wrote: ----

Daryl Davis said:
Can someone help me with this. I am reading the MSDN on this but it i
making almost no sense to me
this is what I understan
InvokeMember(String, BindingFlags, Binder, Object, Object()) As Objec
The first param is the name of the method I wish to call
Yes

The second param is what type of method I am calling (public, nonPublic
etc...
Yes

The third Param, I have no clu

You should be fine with just null
The forth param is the target, I am unsure what that mean

It's the object to invoke the method on
The fifth param is an array of arguments, Are these the arguments for th
method? I don't know

Yes
 
Charles said:
I am trying to understand this too. Eventhough I think I understand
InvokeMember I am not sure if I am getting the syntax correct. For
details what I am trying to do see the post at
microsoft.public.dotnet.framework titled, "Filling Public Properties
in a class from a database".

I am trying to fill public properties from a database with
tC.InvokeMember("DatabaseColumnName", BindingFlags.Default Or
BindingFlags.SetProperty, Nothing, tC, "DataBaseColumnValue"). Is this
the correct syntax for doing what I want?

I suspect the problem is that you haven't specified
BindingFlags.Instance/BindingFlags.Static or
BindingFlags.Public/NonPublic.
 
so I have it running, I can see that I have created and instance of the dll
running on the server. When I run the invoke member I recieve
System.MissingMethodException - Method System.__ComObject.GetCardFace not
found..

Any Ideas on this?
 
Back
Top