G
George Lee
How do you get a return value from macro when called from C#?
Microsoft shows this but how does oApp.GetType().InvokeMember (the call that
invokes the macro) get to return a value? Assume GetMemberStatus takes one
parameter and returns a value such as a long.
…
Access.ApplicationClass oAccess;
oAccess = new Access.ApplicationClass();
oAccess.OpenCurrentDatabase(accessDataBaseName, false, "");
RunMacro(oAccess, new Object[] { "GetMemberStatus", memberID});
…
private void RunMacro(object oApp, object[] oRunArgs)
{
oApp.GetType().InvokeMember("Run",
System.Reflection.BindingFlags.Default |
System.Reflection.BindingFlags.InvokeMethod,
null, oApp, oRunArgs);
}
Microsoft shows this but how does oApp.GetType().InvokeMember (the call that
invokes the macro) get to return a value? Assume GetMemberStatus takes one
parameter and returns a value such as a long.
…
Access.ApplicationClass oAccess;
oAccess = new Access.ApplicationClass();
oAccess.OpenCurrentDatabase(accessDataBaseName, false, "");
RunMacro(oAccess, new Object[] { "GetMemberStatus", memberID});
…
private void RunMacro(object oApp, object[] oRunArgs)
{
oApp.GetType().InvokeMember("Run",
System.Reflection.BindingFlags.Default |
System.Reflection.BindingFlags.InvokeMethod,
null, oApp, oRunArgs);
}