Reflection on COM Interop objects
问题 Trying to create a mapper for an Microsoft Office object to POCO's and found this // doesn't work // returns an empty array where o is a RCW on an office object foreach(var pi in o.GetType().GetProperties() ) tgt.SetValue(rc, pi.GetValue(o, null)); so have to resort to this foreach(var field in tgt.GetFields() ){ var pv = o.InvokeMember(field.Name, System.Reflection.BindingFlags.GetProperty, null, o, null); i.SetValue(rc, pv); } which works for now but wondering why the RCW.GetProperties()