-
reflection error
hi,
i'm having error "Member not found." from the following code(in time of invoking member)..
Code:
foreach (MemberInfo mi in type.GetMember("test_mdi_Init"))
{
type.InvokeMember (mi.Name.ToString(),
BindingFlags.Default | BindingFlags.InvokeMethod,
null,
ibaseObject,
arguments);
}
what could be the problem? thanx for help :)
-
Re: reflection error
I'm guessing that MethodInfo.Name is not giving you the correct value to pass to InvokeMember. Try using the Invoke method of the MethodInfo object instead.
-
Re: reflection error
Err... No, that actually passed the right value. i'v made mistake. i didn't make the method as 'static'. later i read on MSDN that i must do that, so now it's working fine. sorry for my bad :( , and thanks for helping me :)
-
Re: reflection error
Cool, that makes sense. Don't forget to resolve your thread from the Thread Tools menu.